Replies To: Difference between these 2 methods to define an instance of Object?

Re: Difference between these 2 methods to define an instance of Object?

Posted 19 July 2011 - 05:50 PM

With the first statement you don't need to import the Object class however, the Object class is the superclass of all Java classes and will be imported no matter what.

You can also try instanciating other classes using the first notation. However you do not see that often since importing the class\package needed at the top of the Java class is the way to go to avoid the long typing and to make the methods available to you easily.