OOPs(Object-Oriented Programming )
OOPs(Object-Oriented Programming ):-
Object-Oriented Programming is a paradigm that provides many concepts, such as inheritance, data binding, polymorphism, etc.
Simula is considered the first object-oriented programming language.
Smalltalk is considered the first truly object-oriented programming language.
The popular object-oriented languages are Java, C#, PHP, Python, C++, etc.
Object Oriented Programming Language: A language that supports all principles of an object oriented programming is known as an object oriented programming language.
Object Oriented Principles:
1) Encapsulation
2) Abstraction
3) Inheritance
4) Polymorphism
To use the above principles in a Java programming, we need the following language constructs:
1) Class
2) Object
Variables:
A variable is a container that contains data.
There are three types of variables in Java:
1) Instance Variables
2) Class Variables
3) Local Variables
Object:-
There are 3 ways to initialize object in Java.
By reference variable
By method
By constructor
Class -dag
Properties
Behiever
Color
eat()
Size
sleep()
age
run()
Comments
Post a Comment