You are on page 1of 5

Identifier declaration: An identifier start with _,character, currency sign($).

After first character any combination of _,character, currency sign($). An identifier have no length An identifier should not be a key word. key word: Java have 50 keyword.

Methods Naming convention: Java beans method start with get,set,is,add,remove for accessing property of class. Private instance variable is known as property. Listener start with add<listener>or remove<listener>.

File Declaration rules: A file can have only one public class. If a file have a public class then it save should with public class name. A file have only one package statement that is work for all classes of file. Package statement should be first line of file If a file not have package statement then import statement should be first.

A file can have more them one import statement. A file can have public class and interface. var_args in method: var_args feature add in Java1.5 only one var_args argument allowed in method. A method can have both simple variable and var_args argument but var_agrs variable should be last in declaration. Syntax for var_args int... a. Access modifier: Java has 3 access modifier public, protected, private. Java have 4 access level public, default, protected, private. A class by default have default access level. You cannot declare manually any class, method, variable default.

Non Access class modifier: java non access class modifier final, abstract, strictfp. A class cannot declare final and abstract. Final class: A class known as final if Name of class followed by final key word. A final class cannot inherit from another class.

Abstract class: A class is makes abstract with abstract key word. An abstract class can have one or more abstract and complete method. An abstract method not has any definition. Creating Concrete class form Abstract class: A concrete class should define abstract methods of abstract class. A concrete class cannot throw check exception from abstract class method. A concrete class cannot throw super class exception that is declares in abstract class. A concrete class can throw unchecked exception.

Interface: An interface declares with keyword Interface. An interface is full abstraction. Method of an interface is by default public and abstract. Variables of an interface is by default public, static, final means interface only declare constraints. An interface method not declares as static, final, native. An interface can extend another interface. Concrete class form interface:

A concrete class makes by implementing interface and use keyword implements. A concrete class should be define all methods of interface. A concrete class can not declare checked exception for an interface method. A concrete class can not declare broad exception for an interface method. A concrete class can declare unchecked exception for an interface method.

Final: A final is used for completion. If you declare a class final than this class can not inherit by any class. If A method is declare as final than that can not overridden in inherited class. If A variable declare as final than value of this variable can not change. You can declare a argument as final. Synchronized: If a method is declare synchronized than it is used by one thread at a time. Native Method:

A native modifier indicate that a method implements a platform dependent code. Native only apply only for methods. Native method body is ; as an abstract mehod.

You might also like