Reputation: 2630
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?
Upvotes: 8
Views: 4249
Reputation: 18806
Would declaring a static interface
be considered a class in this instance? If not then there's another use.
Upvotes: 1
Reputation: 100776
static import (since java 1.5):
import static my.package.MyClass.*;
Upvotes: 16
Reputation: 15821
Constants - static final (which is really the same as #1, but could be consider a separate usage)
Upvotes: -1