Possible Duplicates:
Usage patterns for private, static, final, public, abstract keywords in java.
In Java, what's the difference between public, default, protected, and private?
what is the difference between the abstract, public, private classes?
Possible Duplicates:
Usage patterns for private, static, final, public, abstract keywords in java.
In Java, what's the difference between public, default, protected, and private?
what is the difference between the abstract, public, private classes?
Public classes are accessible from all other classes, whereas private classes are only accessible from within the class itself. This is a good summary of the Java visibilities:
Modifier Class Package Subclass World
public Y Y Y Y
protected Y Y Y N
no modifier Y Y N N
private Y N N N
Abstract classes are a bit of a different beast. An abstract class is one that cannot be instantiated. In other words, you cannot invoke new
on an abstract class; you would need to do so an a concrete sub-class.