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


Please Help Members By Posting Answers For Below Questions

What is collection sort in java?

556


What is polymorphism and what are the types of it?

508


What are the different types of constructor?

526


What is primitive array?

522


List some features of the abstract class.

593






What is token in java?

533


What is difference between null and void?

531


Is string a data type in java?

592


How do you reverse a string in java without using string buffer?

592


What is data structure in java?

536


What are the six ways to use this keyword?

610


Define max and min heap, also the search time of heap.

591


How can you write a loop indefinitely in java programming?

552


How hashmap increases its size in java?

493


Can a list be null in java?

544