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 / 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 abstract class in Java?

1081


design an lru cache in java?

944


What is int argc char * argv?

1079


explain the concept of virtual method invocation in polymorphism in detail?

2168


Can we pass null as argument in java?

905


Is set thread safe java?

874


Detail discussions on JVM, memory management and garbage collector.

938


What is final keyword in java? Give an example.

972


What are java threads?

1075


What is the difference between private & public & friendly classes?

1033


Explain the available thread states in a high-level?

922


Explain about static imports in java?

958


Can you declare the main method as final?

972


what is the constructor and how many types of constructors are used in java?

957


What is a local, member and a class variable?

993