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 / dilip
any class
| Is This Answer Correct ? | 4 Yes | 9 No |
Post New Answer View All Answers
Can we have two methods in a class with the same name?
State differences between C and Java?
Give any two differences between C++ and java.
What is meant by memory leak?
What is a get method?
Can inner class have constructor?
What is autoboxing and unboxing?
What is difference between calling start() and run() method of thread?
what do you mean by marker interface in java?
I don’t want my class to be inherited by any other class. What should I do?
Convert Binary tree to linked list.
Explain a situation where finally block will not be executed?
What is meant by null and void?
What is polymorphism and what are the types of it?
Can an interface implement another interface?