What is the difference between objects and primitives in Java?

Primitives are passed by value, i.e. a copy of the primitive itself is passed. Whereas for objects, the copy of the reference is passed, not the object itself . Primitives are independent data types, i.e. there does not exist a hierarchy/super class for them. Whereas every Object is descendent of class “Object”.

Sizin İçin Seçtik  Is of type Java?

Leave a Reply

Your email address will not be published. Required fields are marked *