Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

instantiating a static object  RSS feed

 
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
Sheriff
Posts: 16028
87
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 ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!