java access modifiers public protected private

java access modifiers public protected private

#java #public #private #protected

// *
public: visible in all classes in all packages
protected: visible to all classes in the same package or classes in other packages that are a subclass
default: visible to all classes in the same package
private: visible only in the same class
// *

java access modifiers public protected private