Académique Documents
Professionnel Documents
Culture Documents
System.out.println ();
Scanner scan1=new scanner (system.in);
System.out.println (enter a number);
Int x=scan1.nextint ();
METHODS
Public static void method()
{
}
Publicaccess modifiers
Static --- belong to class
Void --- return type
Access modifiers
Access levels
modifiers
class
Package
subclass
world
Public
protected
No modifiers
private
OOPS CONCEPTS
Agenda:
Component:
A ready to used third party object can be called as a component. It can be
replaced without any changes in the application. A component is generally
used by a programmer as an object.
Ex: A projector in a class room is a third party object. We generally dont
build projector. It is readily available in market, we simply plug in it.
People who build projector generally build projector for several application
like watching movies, classrooms.
Loosely coupled objects are better than tightly couple objects i.e., the lesser the
information given to other objects the better it is as the object are loosely coupled
the dependencies are less and strong security.
Ex: we dont need to know wife, children name of teacher.
Technology behind the working of fan we dont need to know
Three feature of OOPs
Encapsulation
Inheritance
Polymorphism
ENCAPSULATION:
The process of binding data and behavior i.e., functionality of an object
within a secured and controlled environment is called encapsulation.
It keeps the data safe from outside code
This encapsulation principle is used to implement the information hiding i.e.
data abstraction
Data Abstraction: The process of exposing the essential data of an object to the
outside of the world and hiding the low level data of that object is called data
abstraction
The principle of data hiding helps the programmer to build secure programs
that do not disturb the code in other parts of program.
INHERITENCE:
The process of acquiring the existing functionality of parent and by new
added features and functionality by a child object is called inheritance.
Using inheritance redundant programs, programming codes can be
eliminated and the use of previously defined classes may be continued.