Given:
1. package test;
2.
3. class Target {
4. public String name = “hello”;
5. }
What can directly access and change the value of the
variable name?
1 any class
2 only the Target class
3 any class in the test package
4 any class that extends Target
Answer Posted / manikandan [ gtec,vellore ]
Public is Visible to everywhere.
Private is visible to only the same class.
Protected is visible in same package and also sub classes in
any package.
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
Why we used vector class?
What happens when main () method is declared as private?
What is wrapper class example?
Can you add null to a list java?
What is keyword in oop?
Is set thread safe java?
What is the difference between and ?
Can we declare an interface as final?
Does list maintain insertion order java?
Can we declare the static variables and methods in an abstract class?
What is the difference between a field variable and a local variable?
How can we create a synchronized collection from given collection?
Is double bigger than float?
Does chrome use java?
How many types of equations are there?