Question: what is the difference between public private protected and static in java?
Answer: Explanations. A private member ( i ) is only accessible within the same class as it is declared. A member with no access modifier ( j ) is only accessible within classes in the same package. A protected member ( k ) is accessible within all classes in the same package and within subclasses in other packages.