• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

instantiating a static object

 
Kondapally Ashwin
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15354
39
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
'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 ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic