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 Soft Skills this week in the Jobs Discussion 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: 14423
    
  23

'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 8 API documentation
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: instantiating a static object