You are on page 1of 3

OOPS Object Oriented Programming System (OOPS):- There are any features of OOPS. 1. Class/Object. 2. Encapsulation. 3. Abstraction. 4. Inheritance.

5. Polymorphism. Class: - class is a container which contains fields and methods. Object: - Instance variable of class. Encapsulation: - it is a process of wrapping fields and methods together into single unit is called Encapsulation. Abstraction: - it is a process of hiding the implementation details and showing only functionality to the user. Inheritance: - Extending a new class from existing classes is called inheritance. Polymorphism: - the ability to take more than one form is called polymorphism. There are two types of polymorphism. 1. Static polymorphism 2. Dynamic polymorphism. Access Specifier:- specifies the scope of member data, methods, classes and interfaces. There are 4 types of access specifier in Java: 1. private : within class 2. protected : within class and derive classes 3. package* : within folder/directory 4. public : anywhere Data Hiding:-by using private modifier we can achieve data hiding. The main advantage of data hiding is security.

Constructor: - a constructor is similar to a method that is used to initialize the instance variables. A constructor has the following characteristics 1. Constructor name should be same as class name. 2. A constructor does not return any value, not even void. 3. A constructor is automatically called at the time of creation of object. 4. A constructor is called and executed only once per object. Inheritance and overriding concepts are not applicable to the constructor but overloading is applicable. There are two types of constructors a) Default constructor. b) Parameterized constructor: - it is useful to initialize each object with different data. Method: - method represents a group of statements that perform a task. Here task represents a calculation or processing of data. Method signature: - in java method signature consist name+parameter list. Return type is not part of method signature. of method

Compiler always use method signature while resolving the method calls. Method Overloading: - writing more than one method with same name but different signatures are called method overloading. Overloading is done in same class. In method overloading, method resolution always take care by compiler on reference type and aruments Method Overriding: - writing more than one method with same name and same signatures are called method overriding. Overriding is done in super class and sub class. The overriding method resolutions always take care by JVM based on the runtime object. Rules for method overriding: Method name and parameter list must be same. Return type must be same. Static keyword: - it is applicable on block, method and variable. Static variable: - it is also called class variable. It is stored on method area of JVM.

Its single copy in memory is shared by all objects. Static method: - a static method is method that does not act upon instance variables of class. A static method is declared by using the keyword static static methods are called using Classname.methodname();. Static block: - a static block is a block of statements declared as static. Static{ statements;} JVM execute a static block on a highest priority basis. Then JVM execute static method (main ()) and then create only it creates the objects. This keyword: - it is a keyword that refers to the object of the present class. When the object is created to the class, a default reference is also created internally to the object. Super keyword: - it is a keyword that is refers to super class variables, methods and constructors. Super.variable; super.method (); super (Values);

You might also like