Java-Object Oriented Programing

Basic concept of object oriented programming

Tharuksi Gunasekara
2 min readApr 6, 2022

Hello friends, in this article, I am going to discuss with you the basic concepts of object oriented programming with java. Java is an object oriented programming language.So, everything in java is associated with objects and classes.Not only that it also combined with attributes and methods.

First of all, will see how to create custom classes and objects in your java program.So, let’s go to the topic.

Classes and Objects.

  • What is the “class”?

Class is a collection of objects or set of objects.

Therefore, we can say, the class is a blueprint of objects.

  • How to create a “class”?

We use the vehicle for a class name and set doors for a variable:

According to the international standard, when we write the first letter of the class name, it should be a capital.Then, we can understand easily whether is it a class or object?.

  • What is an “object”?

Object is an instance of class. Therefore, object is an entity which has state and behavior.

EX: chair, pen, table, keyboard

It does not matter whether your object is physical or logical.According to the objects in the class, it can share common attributes(variables) and behaviors(methods).

  • How to create an “object”?

We create an object for a car and a bus.

  • How to create an object and class together and get an output?

These are the basic things of object oriented programming and that you need to know, because you cannot understand OOP concepts without knowing basic things.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Tharuksi Gunasekara
Tharuksi Gunasekara

Written by Tharuksi Gunasekara

I am an undergraduate of faculty of Information technology in university of Moratuwa

No responses yet

Write a response