Saturday, February 2, 2019

Class and Object in Java with Examples

In real-world an entity that has state and its behavior is known as an object.
For Example:
  • A Car is an object. It has states (name, color, model) and its behavior (changing gear, applying brakes).
  • A Pen is an object. Its name is Parker; color is silver etc. known as its state. It is used to write, so writing is its behavior.
In real-world object and software object have conceptually similar characteristics. In terms of object-oriented programming, software objects also have a state and behavior.

Also Read: Java Interview Questions Java println Java Constructor Wells Fargo Routing Number Bank of America Routing Number liteblue java constructor interview questions core java interview questions 

No comments:

Post a Comment

Java String Interview Questions and Answers

1) What is String in Java? Is String is data type? String in Java is not a primitive data type like int, long or double. The string is a ...