ACCESS MODIFIER

public

public access modifier is used when we want the variable or methods declared to be accessible from anywhere, whether it be inside or outside the class.

private

private keyword makes the variable or method accessible only from inside the class.Â