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
How do you declare an array that will hold more than 64KB of data?
Which java collection does not allow null?
What is difference between Heap and Stack Memory?
Explain the polymorphism principle?
What is a condition in java?
What is a jit compiler?
How do you check if two given string are anagrams?
What is hotjava?
What do you mean by scope of variable?
What is the maximum length of a url?
Why deletion in linkedlist is fast than arraylist?
What does java se mean?
What is the function of java?
What does exp mean in math?
How can you generate random numbers in java?