I learned that the way to create objects in java is by using the "new" keyword... but i am confused when my professor told me that "Object dog = new Object()", he told that this is the way to do an instance of a class. What's the object here ... what's the instance of class here? Thank you.
"An object is an instance of a class" Consider another example
Student amit = new Student()
'Student' is the class 'amit' is a reference variable that points to a new instance of Student ie. 'amit' is an object of student.
In your example Object dog = new Object() In this case, our class is Object and object is dog. Note the difference between Object and object. Object is a real class in Java, superclass of all classes, top of hierarchy. Whereas 'object' with a small o refers to an instance of that class.