0 votes
in JAVA by
What is class in Java?

1 Answer

0 votes
by

What is class in Java?

1) In the real world, you often have many objects of the same kind. For example, your bicycle is just one of many bicycles in the world. Using object-oriented terminology, we say that your bicycle object is an instance (in the glossary) of the class of objects known as bicycles. Bicycles have some state (current gear, current cadence, two wheels) and behaviour (change gears, brake) in common. However, each bicycle’s state is independent of and can be different from that of other bicycles.

2) When building bicycles, manufacturers take advantage of the fact that bicycles share characteristics, building many bicycles from the same blueprint. It would be very inefficient to produce a new blueprint for every individual bicycle manufactured.

3) In object-oriented software, it’s also possible to have many objects of the same kind that share characteristics: rectangles, employee records, video clips, and so on. Like the bicycle manufacturers, you can take advantage of the fact that objects of the same kind are similar and you can create a blueprint for those objects. A software blueprint for objects is called a class (in the glossary).

Related questions

0 votes
asked Jan 24, 2021 in JAVA by rajeshsharma
+2 votes
asked May 6, 2021 in JAVA by SakshiSharma
...