OOP Java Concepts with Examples

2
265

OOP Java Concepts with Examples

Today I’m going to tell you the basic concept of OOP in Java.

A Java program is considered as a bunch of Objects that use methods functions to communicate among them.

Let us see what these objects and methods consist of:

1. Object -an object has its states and behaviors.

Let’s take a look in this “Fan” as an example. A Fan has its state.

That means, it has its color, shades, and behavior is ” moving” of a fan.

The instance of a class is referred to when an Object is called.

Now wondering what a class is?

2. Class – consider being the blueprint that consists of the states and behavior.

See the example java code.

3. Methods – a method is referred to as behavior. Therefore, logic is written to execute a program.

A single class can have as many methods as the user wishes.

Your first program with OOP Java Concepts

For further information about the OOP Java concepts, you may visit here to get more idea about the oop in java.

Please Check the next Topic. Datatypes in Java

Facebook Comments

    2 COMMENTS

    Leave a Reply

    This site uses Akismet to reduce spam. Learn how your comment data is processed.