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

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -