Just now i completed reading Java In 60 min a Day By R. F. Raposa
Nice book written by R. F. Raposa.I skipped both chapters related to Swing as i am not interested in knowing about swings currently and also i skipped chapter on applets as i believe they are more closer to deprecation.
Few points i want to share from the book
1) In Java, the platform you target is a Java Virtual Machine, or JVM for short. You do not write Java programs for Windows, Unix, a Palm PC, or any other device. You write Java programs to run on a JVM.
2) JIT stands for Just-In-Time and refers to a JVM that compiles portions of the bytecode of a Java program into native code when the program is executed.
3) In the early days of programming, programs were designed using flowcharts and a sort of top-down design. With this type of design, a large problem is solved by breaking it down into smaller tasks. For each of the smaller tasks, a procedure is written. One main procedure was written to start the process and subsequently flow through to the solution, invoking the desired procedures along the way.
This type of programming is referred to as procedural programming. There are many procedural programming languages widely used today, most notably COBOL and C.
4) With object-oriented programming, data is still passed around between method calls as in procedural programs. However, there is an important distinction to be made when comparing procedural programming with object-oriented programming. The data that is passed around in an objectoriented program is typically varying data, such as the number of hours an employee has worked in a week. It is not the entire Employee object that gets passed around.
If a procedure in a procedural program needs data to perform a task,the necessary data is passed in to the procedure. With object-oriented programming, the object performs the task for you, and the method can access the necessary data without having to pass it in to the method.
For example, if you want to compute an employee’s pay, you do not pass the corresponding Employee object to a computePay() method. Instead, you invoke the computePay() method on the desired Employee object. Because it is a part of the Employee object, the computePay() method has access to all the fields in the Employee object, including the Employee object’s hourly pay, salary, and any other required data.
5) When an argument is passed in to a parameter, the argument’s data is copied into the parameter. The process of copying data between method calls is referred to in programming as call-by-value.
In Java, you do not specify that an argument is to be passed using callby-value. It happens automatically, and is, in fact, your only option. Other programming languages use call-by-reference and/or call-by-pointer, in which an argument is not copied into a parameter. You cannot do call-byreference or call-by-pointer in Java. No matter what type of argument you pass in to a method, the corresponding parameter will get a copy of that data, which is exactly how call-by-value works.
6) A constructor is a special method in a class that is invoked when the object gets instantiated. The purpose of a constructor is to allow the fields of the object to be initialized when the object is instantiated.
7) A hash table is a data structure that maps keys to values. A hash table can be viewed as a collection of buckets, with each bucket able to hold any number of entries. Adding an object to a hash table involves deciding which bucket to place the object in, a process referred to as hashing.
Every object in the hash table generates a hash code as determined by its hashcode() method. Every object has a hashcode() method that it inherits from java.lang.Object. Aclass that is to be used with hash tables should override the hashcode() method and return a unique value for different objects. The general rule is that if two objects are not equal as determined by their equals() method,the two objects should return different hash codes.
For example, the Employee class in the following listing uses the employee’s number as its hash code. Notice that the equals() method in Employee defines two Employee objects as equal if they have the same number, which means that different Employee objects have a different hash code.
8) However, an interface is different from a class in several ways, including:
You cannot instantiate an interface.
a) An interface does not contain any constructors.
b) All of the methods in an interface are abstract.
c) An interface cannot contain instance fields. The only fields that can appear in an interface must be declared both static and final.
d) An interface is not extended by a class; it is implemented by a class.
e) An interface can extend multiple interfaces.
9) A process consists of the memory space allocated by the operating system that can contain one or more threads.A thread cannot exist on its own; it must be a part of a process.A process remains running until all of the non-daemon threads are done executing.
A daemon thread, by definition, is a thread that does not keep the process executing.Use a daemon thread for a task that you want to run in the background only while the program is still running. The garbage collector of the JVM process is a good example of a daemon thread. The JVM wants the garbage collector to always be running in the background, freeing memory of unused objects. However, if the garbage collector is the only thread running, there is no need for the JVM process to continue executing.
10) Every thread belongs to a thread group. The java.lang.ThreadGroup class represents a thread group, and Thread objects are associated with a group using one of the Thread constructors with a ThreadGroup parameter. If a thread is not specifically added to a thread group, it belongs to the default thread group created by the JVM called main. Creating a ThreadGroup is useful when managing a large number of threads.
11) An object’s lock is often referred to as its monitor. The term monitor refers to that portion of the object responsible for monitoring the behavior of the wait() and notify() methods of the object. To invoke any of the wait() or notify() methods, the current thread must own the monitor (lock) of the Object, meaning that calls to wait() and notify() always appear in a critical section, synchronized on the Object.
About the Author
Richard F. Raposa is a Java instructor for JLicense, Inc., a Java courseware and training firm based in Rapid City, SD. One of the first Sun Certified Java Instructors, Rich has taught courses on Java, J2EE, XML, Web Services, C++,Visual C++/MFC, Win32 Internals, UML, and other object-oriented technologies at companies around the country. He has developed courses on almost every aspect of Java and the J2EE technologies
Tuesday, 5 August 2008
Subscribe to:
Post Comments (Atom)
4 comments:
It was a wonderful post.
Anonymous,
Thanks a lot for your comments.
Thanks
prashant
Hi!
I felt very happy that your blog introduces to its readers my favourate java introduction book learning java/java 60 minutes a day.
Yes I can't say in words that much I like this Book.Actaully i never found this book in my engineering days ,after getout with firstclass eng degree with very less knowledge of java I found this book at my friends room,after seeing this For its good sige font i started reading,but one thing I can't forget is that is is the first book I read whole,and you can found no word is waste in this book.And To bought this book i took a hard work search and finally witrh me now ,it is really a heart to my java knowledge .
And if you ahve any info on j2EE book like this from rf raposa or any other titles from him like this plz post a comment
I love this book very much so i choose his name for my comapny ,as a thankx to him
kk
http://cellphonebiz.blogspot.com
Thanks Kumar
Post a Comment