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
Why do we need new date and time api in java se 8?
Where are group policies stored? : java security
What is a cookie in java?
What is savepoint in java?
What is singleton pattern in java?
What is an actionevent in java?
How do I run a project in eclipse?
Can the main method be overloaded?
Can I have multiple main methods in the same class?
What are struts java?
What is a stream in programming?
What is a delimiter in java?
What is entitymanager in java?
What is the use of rs next () in java?
What is gwt in java?