Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 / amit singh

first i want to see the visibility of class itis
default acees
the class is default acess so this class is visible in a
same package
so then the member in it public so
1)so the class in the same package will acess it
2)the class in the same package which extends this class
can acess it
not any other class in the whole world or subclass in other
package.
thanks amit singh
amitsing2008@gmail.com

Is This Answer Correct ?    17 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

when should you use stringbuilder class in a program?

944


When should I use a singleton?

996


Difference between Preemptive scheduling vs. Time slicing?

992


What is a function in java?

985


What is polymorphism in java? What are the kinds of polymorphism?

1033


What is a numeric format?

1034


What is the purpose of the wait(), notify(), and notifyall() methods in java programming?

1029


define the terminology association.

1071


how many types of Inheritance?

1135


Can we define package statement after import statement in java?

974


Write a java program for binary search?

1017


What is the advantage of OOP in java?

1099


How does the garbage collector works in java?

1058


What is an anonymous class in java?

1038


What are the 5 types of research methods?

1114