The static keyword is used in Java mainly for memory management. It is used with variables, methods, blocks and nested class. It is a keyword that is used for share the same variable or method of a given class. This is used for a constant variable or a method that is the same for every instance of a class.