There are following four types of access modifiers in java which are:
public: accessed from anywhere.
private: can't be seen outside of its class.
protected: accessed by classes in the same package and subclasses in the other packages.
default modifier : Can be accessed only to classes in the same package.