The difference between the final class and the static class

I know a little java, used final and static several times, but I'm a little confused here: what is the main difference between the final class A and static class B. I know these keywords. I just could not imagine using final in a class declaration.

+4
source share
1 answer

Final class: in simple words is a class that cannot be extended. - As a rule, it is useful that the classes are immutable, for example. String class, which is usually executed for security.

Static class: Static classes can only be used with nested classes. - A nested static class does not require a reference to the Outer class, but a non-static nested class needs it

+8
source

All Articles