5 ways to use the static keyword in Java

java, keyword, static

Solution

static import (since java 1.5):

import static my.package.MyClass.*;

Problem

I just had an interview where one of the questions was something like "Describe 5 ways to use the static keyword in Java." I could only think of 2 on the spot, and afterwards I found 2 more. What is the 5th? - Declaring a field belonging to a class as opposed to an instance of the class. - Declaring a method that can be called on a class as opposed to an instance. - Declaring a nested class as static - Defining a static class initializer. - ???

Original source