[Solved] Object ob; and Object ob = new Object; [closed]


First is declared object:

Object ob;

Note that declarations do not instantiate objects. When object is declared, its value is initially set to null.

Second is declared and instantiated object:

Object ob = new Object();

In this case you are initialize new object of type Object over constructor methods.

Quick info you can get here. You can also get a lot of information in various java tutorials.

solved Object ob; and Object ob = new Object; [closed]