+ 2
whats the deference between public and private
2 Réponses
+ 2
The public access modifier means that particular class,field,constructor,method is visible and accessible to every other class ( outside world ).
The private access modifier means that particular field,method is only visible and accessible within the class its defined in.
+ 1
public means any class any method can access to it and private means only the class in which it is present can be accessed