It seems like it should be fairly simple, but I am having trouble moving my brain around it. You typically declare an object in one of two ways.
ClassName a;
a = new ClassName();
or
ClassName a = new ClassName();
etc...
but since you explicitly declare them at compile time, I am embarrassed when Im should code this at runtime. What I want to do is a new instance of the class created at the click of a button. But I donโt understand how the name of the object will be called if this happens when the button is pressed?
source
share