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 / lakshman
any class that extends Taget
| Is This Answer Correct ? | 6 Yes | 6 No |
Post New Answer View All Answers
What is the difference between variable declaration and variable initialization?
Why is an interface be able to extend more than one interface but a class can’t extend more than one class?
What is another word for methodology?
How do you sing an Applet ?
Are the imports checked for validity at compile time? Will the code containing an import such as java.lang.abcd compile?
When wait(), notify(), notifyall() methods are called does it releases the lock or holds the acquired lock?
Does constructor be static?
Can we override the static methods?
What is set in java?
What is off heap memory?
Why do you canvas?
How do you create immutable object in java?
Explain 5 features introduced in jdk 1.7?
What is package private scope in java?
Explain the difference between treeset and treemap in java?