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
How do I open my java console?
Can we write lambda without functional interface?
How does java handle integer overflows and underflows?
Why do we need framework in java?
Which is better openjdk or oracle jdk?
What gives java it’s “write once and run anywhere” nature?
What is proxy object in java?
Is java installed on windows 10?
Are streams faster than for loops?
What is injection in java?
Explain main thread under thread class execution?
What is the java virtual machine (jvm)?
For each of the following program segments,give a big zero
analysis for the running time
1.For (i=0;i can anyone tell me what kind of questions are asked for
core java exam in aptech Describe the principles of oops.