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 / kumar
By default,the package and class are public.the result will
be 4 any class that extends Target.
Is This Answer Correct ? | 0 Yes | 4 No |
Post New Answer View All Answers
What is collection sort in java?
What is polymorphism and what are the types of it?
What are the different types of constructor?
What is primitive array?
List some features of the abstract class.
What is token in java?
What is difference between null and void?
Is string a data type in java?
How do you reverse a string in java without using string buffer?
What is data structure in java?
What are the six ways to use this keyword?
Define max and min heap, also the search time of heap.
How can you write a loop indefinitely in java programming?
How hashmap increases its size in java?
Can a list be null in java?