The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
March 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

and?

Posted by Bumle on May 15, 2001 at 1:33 PM

> classname object=new classname();

>
> creates a variable called object with a special type of variable called a classname. The object variable stores the result of classname().

> new is a reserve word which shows you are creating a variable (here named object) to store a result.

>
> See another example:

> Dog doggie = new Dog();

> One new object is created, a Dog object called doggie.
> Here dog() is class file and you are allocating a variable doggie to store result of dog()class.


And?



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us