-4

It is a basic unit of Object-Oriented Programming and represents real-life entities. A typical Java program creates many objects, which as you know, interact by invoking methods. An object consists of :

  • State: It is represented by attributes of an object. It also reflects the properties of an object.
  • Behavior: It is represented by methods of an object. It also reflects the response of an object to other objects.
  • Identity: It gives a unique name to an object and enables one object to interact with other objects.

Is Object a datatype in Java?

Arvind Kumar Avinash
  • 71,965
  • 6
  • 74
  • 110
Amit Anand
  • 103
  • 1
  • 3
  • 10

1 Answers1

2

Is Object a datatype in java?

Yes.

Every class in Java is a datatype and Object is a class which means that it too is a datatype. It is special as it is a superclass of every class in Java.

kaya3
  • 47,440
  • 4
  • 68
  • 97
Arvind Kumar Avinash
  • 71,965
  • 6
  • 74
  • 110