Static nested class in Java

Java has “static nested classes“. A static nested class is just one which doesn’t implicitly have a reference to an instance of the outer class. This saves the 8-byte inner class object overhead.

Static nested classes can have instance methods and static methods. There’s no such thing as a top-level static class in Java. Class can be labeled as final and static to simulate this behavior, and the constructor should be also made “private” to prevent instantiation.

References: 
http://stackoverflow.com/questions/7486012/static-classes-in-java

Final Class in Java

A final class is simply a class that can’t be extended, however that a final class can still extend another non-final class, it is mainly needed for efficiency and security reasons.

As an Example:
If the equals method of a class is defined manually, this class can be considered to be defined as final to prevent being extended by a Subclass. Logically, if this equals method is called by it’s Subclass, the property of equality might not be guaranteed for the Subclass.

Reference:
http://stackoverflow.com/questions/5181578/use-of-final-class-in-java

Reference (final in java):
http://javarevisited.blogspot.de/2011/12/final-variable-method-class-java.html

Super and extends in java generic

Question about java generic:
Why is “extends T” allowed but not “implements T”?

Answer:

There is no semantic difference in the generic constraint language between whether a class ‘implements’ or ‘extends’. The constraint possibilities are ‘extends’ and ‘super’ – that is, is this class to operate with assignable to that other one (extends), or is this class assignable from that one (super).

Reference: http://stackoverflow.com/questions/976441/java-generics-why-is-extends-t-allowed-but-not-implements-t

Additional Example of super and extends in java generic:
http://stackoverflow.com/questions/6826916/useful-example-with-super-and-obscurity-with-extends-in-generics/6828257#6828257

Randomized Algorithms