Questions And Answers

More Tutorials

Java Object Oriented Programming

Object-Oriented Programming tries to map code instructions with real-world, making the code short and easier to understand.

With the help of OOPs, we try to implement real-world entities such as object, inheritance, abstraction, etc.

OOPs helps us to follow the DRY(Don't Repeat Yourself) approach of programming, which in turn increases the reusability of the code.

Two most important aspects of OOPs - Classes & Objects :

Class :

1. A class is a blueprint for creating objects.
2. Classes do not consume any space in the memory.
3. Objects inherit methods and variables from the class.
4. It is a logical component.

Objects :

1. An object is an instantiation of a class. When a class is defined, a template (info) is defined.
2. Every object has some address, and it occupies some space in the memory.
3. It is a physical entity.

How to model a problem in OOPs

We identify the following:

Noun             - Class                       - Employee
Adjective        - Attributes                  - name, age, salary
Verb             - Methods                     - getSalary(), increment()


In this page (written and validated by ) you learned about Java Object Oriented Programming . What's Next? If you are interested in completing Java tutorial, your next topic will be learning about: Java Basic Terminologies in Object Oriented Programming.

Incorrect info or code snippet? We take very seriously the accuracy of the information provided on our website. We also make sure to test all snippets and examples provided for each section. If you find any incorrect information, please send us an email about the issue:

Share On:

Mockstacks was launched to help beginners learn programming languages; the site is optimized with no Ads as, Ads might slow down the performance. We also don't track any personal information; we also don't collect any kind of data unless the user provided us a corrected information. Almost all examples have been tested. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. By using, you agree to have read and accepted our terms of use, cookies and privacy policy.