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:-

Really world entity  Eg:-chair, bike, marker, pen, table.

Ways to initialize object:-

There are 3 ways to initialize object in Java.

  1. By reference variable

  2. By method

  3. By constructor

Class :-

Drawing of an object is called class.
Class -dag      
  •  Properties

    Behiever

    Color 

    eat()

    Size

    sleep()

    age

    run()



Comments

Popular posts from this blog

Inheritance in Java

Type Conversions

Life cycle of a Thread and creating thread class