Jump to content

User:Banusanar

From Wikipedia, the free encyclopedia

JAVA TUTORIAL

[edit]

Some Basic Things

  • The construct System.out is the full name of the out variable in the System class. Notice that the application never instantiates the System class and that out is referred to directly from the class name. This is because out is a class variable--a variable associated with the class rather than with an instance of the class. You can also associate methods with a class--class methods.
  • Within the Java programming language, an interface is a type, just as a class is a type. Like a class, an interface defines methods. Unlike a class, an interface never implements methods; instead, classes that implement the interface implement the methods defined by the interface. A class can implement multiple interfaces.
  • The Java runtime environment has a garbage collector that periodically frees the memory used by objects that are no longer referenced. An object is eligible for garbage collection when there are no more references to that object. References that are held in a variable are usually dropped when the variable goes out of scope. Or, you can explicitly drop an object reference by setting the variable to the special value NULL
  • Before an object gets garbage-collected, the garbage collector gives the object an opportunity to clean up after itself through a call to the object's finalize method. This process is known as finalization.The finalize method is a member of the Object class, which is the top of the Java platform's class hierarchy. It is the superclass of all classes. A class can override the finalize method to perform any finalization necessary for objects of that type. If you override finalize, your implementation of the method should call super.finalize as the last thing that it does.
  • A string buffer or string builder's length is the number of characters it contains; its capacity is the number of character spaces that have been allocated.Image

Note: This page in prepared from the Sun Java tutorial page but some main points that I miss sometime while preparing for the JCP exam.