oop - Creating an object differences java -


this question has answer here:

i'm sure question have been answered not sure term search.

i unsure of difference between :

  jpanel = new jpanel();   = new jpanel(); 

with second line need declared variable @ top of class?

can please attach link can find out topic. know basic.

there 3 cases : declaration, initialization, , (declaration, , initialization) :

this declaration of object:

jpanel a; 

this initialization of object :

a = new jpanel(); 

and can make both of them in 1 step :

jpanel = new jpanel(); 

Comments

Popular posts from this blog

java - is not an enclosing class / new Intent Cannot Resolve Constructor -

python - Error importing VideoFileClip from moviepy : AttributeError: 'PermissionError' object has no attribute 'message' -

qt - QML MouseArea onWheel event not working properly when inside QML Scrollview -