The static keyword is used in java mainly for memory management. We may apply static keyword with variables, methods, blocks and nested class. The static keyword belongs to the class than instance of the class.Instance variables declared as static are, essentially, global variables. When objects of its class are declared, no copy of a static variable is made. Instead, all instances of the class share the same static variable.The static keyword can be used in 3 scenarios,they are static variables,static methods and static blocks of code.
A website for basic tutorials and programs in Java. JAVA based tutorial programs.
Showing posts with label variables.methods. Show all posts
Showing posts with label variables.methods. Show all posts
Monday, 20 January 2014
Subscribe to:
Posts
(
Atom
)