Free Guides

Language Tutorials

                            

SUN

Your Ad Here

 
               SUN CERTIFIED JAVA PROGRAMMER FOR JAVA2 PLATFORM 1.4

       Index     

Basics of Java programming

  • Objects are manipulated through object references (and aliases). new operator returns a reference to a new instance of the class instantiated.

  • Objects have their copy of instance members, while static members belong only to the class. Local (or Automatic) variables are created inside methods/ blocks.

  • Static members may be accessed by the class name as well as the object references, but Instance variables can only be accessed by the object reference.

  • Two fundamental mechanisms of building new classes from existing ones :

      • Inheritance (IS-A relationship)

      • Aggregation (HAS-A relationship)

  • Java supports aggregation where only the references to objects and values of primitive data types are stored within the aggregation class.

  • Java 2 SDK enforces that at the most only one class in the source file has public accessibility. Each class definition in a source file is compiled into a separate class file, containing Java byte code.There can be any number of classes named 'main' created in a class, provided they take other arguments, are not public and static, or return a value.