aspose file tools*
The moose likes Beginning Java and the fly likes instantiating a static object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "instantiating a static object" Watch "instantiating a static object" New topic
Author

instantiating a static object

Kondapally Ashwin
Greenhorn

Joined: May 16, 2006
Posts: 25
Hi,

I came across a code which is something like this..

static Test A = new Test() where Test is a class. I am not able to understand the reason for using the static keyword here. I want to know what purpose it serves.

Thanks in advance.
Ashwin
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13869
    
  10

'static' means in this case that the variable A is a static member variable.

See: The Java Tutorial - Understanding Instance and Class Members
[ September 19, 2007: Message edited by: Jesper Young ]

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: instantiating a static object
 
Similar Threads
can't call another constructor from no-arg constructor
Some Codes
Kathy / Bert static final variables
cofused about output of program..?
Object of Class N declared inside Class N itself.