1. Use static keyword to declare a static class member in java.
  2. Declare static variable in a java class.
  3. Access static variable with the help of object and dot keyword.
  4. Access static variable with class name in a java program.

Static Keyword in JAVA video tutorial (Hindi)

Vineet Agrawal

Published on January 12, 2017
  1. Static keyword is used to declare a static class member in JAVA.
  2. Static class member is shared by all instances or objects of the class while all objects use a separate copy of a non-static class member.
  3. Static class members can also be accessed by class name.

class statickeyword
	int a=5; // instance member
	static int b=5; // static member
	public static void main(String args[])
		statickeyword s1 = new statickeyword();
		statickeyword s2 = new statickeyword();
This content is part of the following course: 
Frequently Asked Questions
Required Components