why i can not access private variable in other class?
Answer Posted / srihari
private variables are visible within the class they are
defined but not in the other classes present in same package
& classes in different packages. Hence, we call "private"
variables as "CLASS-LEVEL" instances.
private variables are used when we do not want the variable
declared in a class to be shared or used by other classes
present in same packages or different packages.
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is difference between map and flatmap in java 8?
Who developed rxjava?
What is interceptors in java?
What is the difference between a jdk and a jvm?
What is proxy object in java?
Which is best framework in java?
What is use of jpa?
Why dependency injection is used in java?
What are the Advantages of java se 8 new features?
What is a container in java?
What type of parameter passing does java support?
How do I start netbeans?
What is class forname java?
What is data encapsulation?
What is a stream in programming?