0% found this document useful (0 votes)
3 views

Oop

The document discusses object-oriented programming concepts including objects, state, behavior, identity, responsibility, abstraction, encapsulation, inheritance, interfaces, polymorphism, method overloading, method overriding, constructors, the this and super keywords, and threads.

Uploaded by

Meet Patel
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Oop

The document discusses object-oriented programming concepts including objects, state, behavior, identity, responsibility, abstraction, encapsulation, inheritance, interfaces, polymorphism, method overloading, method overriding, constructors, the this and super keywords, and threads.

Uploaded by

Meet Patel
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

object-oriented programming is a software design approach in which concept of

"object" occupies the first place.

Object is something which has state,behaviour,identity and responsibility.


State : is giving values to attributes.
behaviour:means response given to outside World.
identity : means uniqueness associated with every object
resposibility : role of an object.

Abstraction : means Selective ignorance.(hiding the implimantaion and showing the


Functionality.)
At the end of abstraction we get state of and object.

Encapsulation : is a process of binding and hiding of state and behaviour because


in real life they are inseparable and hidden by default.

Inheritance: is a way of "re-using" already define classes with "is-a"


Relationship. inheritance is achieved by using the extends keyword only public and
protected fields can be accessed in child class.

Interface : is a special block of java which only contain set of abstract method to
provide complete data abstraction.

polymorphism :
when same message given to generalised things for same Behaviour but implemented
differently is called polymorphism

A class with multiple methods by the same name but different parameters called
method overloading

in method overriding a child class has the same method name, same method signature
and same return types as a method in its parent class, then the child class method
haas overriden the parent class method.

Constructor : it is used to initialize the data of the object.


Automatically when we create constructor.
1.Name == Class Name
2.Constructor does not return any value.Not even Void

public Student() // Non-Parameterized Constructor


{
}

public Student(int a,int b,String str) // Parameterized Constructor

When java Create automatically - default Constructor


if class does not have any constructor then java Creates one default Constructor

this Keyword :
-> Refer current invoking object.
-> this()->for calling current class constructor from inside different constructor
of same class.

Super Keyword:
-> Super Keyword refer to immediate parent
super()-> use to call parent class Constructor from inside child class constructor
Threads allows a program to operate more efficiently by doing multiple things at
the same time.

Threads can be used to perform complicated tasks in the background without


interrupting the main program.

You might also like