[program-java] Instance...

  • From: "Corbett, James" <James.Corbett@xxxxxxxxxxxxx>
  • To: <program-java@xxxxxxxxxxxxx>
  • Date: Tue, 10 Feb 2009 13:15:25 -0500

...is there a means to create an instance of a class with out actually 
specifying an object name?

E.G. Class newClass = Class();

I would like not to have newClass created even though it's scope is limited to 
the calling method. If I leave it as it is, the compiler will throw a warning 
indicating the object newClass is never called locally.

I use the above syntax for loading a gui class which never gets used other than 
to create the gui in the first place.

Just wondering.

Jim 

James M. Corbett

A / Technical Specialist
GST/HST Micros | Micros de la TPS/TVH

(613) 941-1338

"Not good science? Why, before writing RELIC, we did extensive scientific 
research on the worldwide problem of brain-eating monsters infesting museums. 
What more could you want?"

                            -- Douglas Preston


Other related posts: