+ 11
What is the deference of private class with other classes?
I want know better description of this.
2 odpowiedzi
+ 4
https://stackoverflow.com/questions/215497/what-is-the-difference-between-public-protected-package-private-and-private-in
Use this form for more info in this topic!
&
tick that tick mark in the left side of my answer, cause it gives me XP 😀
+ 2
Private
Methods,Variables and Constructors
Methods, Variables and Constructors that are declared private can only be accessed within the declared class itself.
Class and Interface
Private access modifier is the most restrictive access level. Class and interfaces cannot be private.
Note
Variables that are declared private can be accessed outside the class if public getter methods are present in the class. Variables, methods and constructors which are declared protected in a superclass can be accessed only by the subclasses in other package or any class within the package of the protected members' class.
Public
A class, method, constructor, interface etc declared public can be accessed from any other class.
Therefore fields, methods, blocks declared inside a public class can be accessed from any class belonging to the Java Universe.
you can never ever make a class private🤓