java - Object ob; and Object ob = new Object; -
please explain difference between these two:
1) object ob;
2) object ob = new object();
first declared object:
object ob;
note declarations not instantiate objects. when object declared, value set null.
second declared , instantiated object:
object ob = new object();
in case initialize new object of type object on constructor methods.
quick info can here. can lot of information in various java tutorials.
Comments
Post a Comment