Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Static in java

 
kumar mdu
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is static in java?

What is static class., static method., static variable and static block?

could anyone explain me detaily?

thanks
 
Sudipta Laha
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please check the oracle java tutorials.
You will get a lot of links in google too..
 
kumar mdu
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got lots of google links for static,

If anyone explain i'll understand well so only i ask

thanks for your reply.
 
Pramod P Deore
Ranch Hand
Posts: 632
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually static is a very big topic in java. You can ask specific thing in that you can't understand.

static variable: When a variable is declared with the static keyword, its called a class variable. All instances share the same copy of the variable.

static Method:When a method is declared static, it can be called/used without having to create a object first. Static Methods Cannot Access Non-Static Variables

static class: you instantiate the inner classes independently of the main enclosing class

 
kumar mdu
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you

It helps me to google it more.

thanks.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15485
43
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you find the following page in Oracle's Java Tutorials?

It explains it in detail: Understanding Instance and Class Members
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic