OBJECT
An object is an identifiable entity with some characteristics & behavior.
Eg. 1. Orange, 2. chair .
Characteristics
Behaviour
Note:-Object interact with each other by passing message.
Creating a class
<Access Specifier> class <class name> {
//data members; variable used by member methods
// member methods; to perform some specific task
}
Creating a object
<class name > < object name> = new <class name >();
Basic concept of OOP (Object Oriented Programming)
2. Encapsulation the wrapping of data (characteristics) and functions (behaviour) into a single unit (class) is known as encupsulation.
3. Inheritance is the capability of one class of things to inherit capabilities and properties from another class .
i) Super class or base class (parent class) : The class from which the other class inherits the properties .
ii) Derived or sub class (child class) : The class which inherits the properties from other class .
4. Polymorphism is the ability for a message or data to be processed in more than one form.(function/constructor overloading). p.
5. Dynamic Binding: It is the process that links the function - call with function signature at runtime.
The object is implemented in software term as follows.
1. Characteristics & Attributes are implemented through member variables or data items of the objects .
2. Behaviour is implemented through member function called methods/function.
Class
Class represents a set of objects that share common characteristics & behaviour.
i )A class is an object maker or object factory because it contains all the statements needed to create an object. It attributes as well as statements to describe the operation that the object will be able to perform.
1.Source program the program written in high level language by programmer is called source code.
4. Java Virtual Machine (JVM) is a JAVA internreter which translates byte code for specific platforms.
1.Java reserve words : reserve words or key words are those words, which are preserved with the system. These words carry the special meaning and can’t be taken as variable name. Comments Symbols: there are three type of Comments in java program
1. Document comment: /** isa document comment */ .
2. Single line comment: // it is a single line comment
3. Multi Line comment: // it is .
c Multi line Comment */
Output Statements is java :
1. System.out.prinitn( “ it print on current line then change line”);
2. System.out.print(” It print on current line”);
Input Statement in Java : Using BufferedReader or Scanner class input operation can be performed.
Difference between JDK and BLUE J
JDK : It is dos based, uses command for compilation. Sample program appears.
Blue j: It is windows based platform uses menu driven approach for compilation. Sample program appears.
Constructor : A member function with the same name as its class is called Constructor and it is used to initialize the object of that class type with a legal initial value. Constructor are three type .
i) Default constructor : Assign default values to the data members of the class.ii) Parameterized Constructor : assign parameterized values to the data members of the class.iii) Copy Constructor : it is used to copy the object value to the data members of the class
Class member : static members are called class members because they share the same memory.
Instant members: Non static members are called instant members because they share the different memory.
0 Comments