+ 4
Why we need object class in java and what is the purpose ?
10 Answers
+ 2
To have a parent class that all top level classes implicitly inherit from.
+ 6
The class isnt the object it's a template/the blueprints of what your object will be when you create an object of that class.
Objects have state and behaviours meaning you can call methods on these objects and many other things which you cant do with primitive types.
+ 5
Classes in general are used to model real-world concepts.
Java is an object oriented programming language, meaning objects are the way to go, and classes are the blueprints for those objects
+ 4
Programmer Raja Please revise your question with more clarification. đ
Your question, as it stands, is unclear and ambiguous as it can be interpreted to mean different things.
Provide addition context on what you're trying to understand so your question is much clearer to anyone willing to help.
For this question, in particular, what do you mean by "object class in Java"? This isn't a proper term in Java. đ¤
In my attempt to guess, you could be asking any of the following:
1. What is a class in Java?
2. Why are classes needed to create an object in Java?
3. Why does Java require everything to be defined in a class?
These are just a few different meanings I considered and each have different answers.
As much as I would like to answer your question, I would have to provide several answers and hope one of them was close to what you were asking about. Otherwise, it would have been a complete waste of my time to even have attempted to answer. đ¤
I hope this advise makes sense. đđ
+ 3
Object class is the parent of all classes so its stores the references off all classes like in polymorphsim
+ 2
Its very important to simulate real word
With classes you can build a car and separate a huge idea to a simple classes you can code
and its help in group working every one can take a class and then you will combine all classes together
+ 2
Java is by default a OOP so monolithic program doesn't exist in Java
+ 1
For encapsulation
+ 1
Platform independence
0
David Carroll sorry for that
There is class called object in java
Which is the super class all class we create
So what is the purpose of that object class need to parent for all class ?