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 / manikandan [ gtec,vellore ]

Public is Visible to everywhere.
Private is visible to only the same class.
Protected is visible in same package and also sub classes in
any package.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we use a default constructor of a class even if an explicit constructor is defined?

1048


What is private public protected in java?

987


How does callback work in java?

994


What is the intersection and union methods?

978


How do you compare objects in java?

883


What do you mean by platform independence of Java?

1067


How listener identify that the event came from a particular object?

1950


What’s the difference between applets and standalone program?

979


What do you mean by platform independence? What is an interface?

981


What are the different types of constructor?

929


What are the actions that can occur when a thread enters blocked state?

1005


What is the core java?

909


What is volatile keyword in java

1070


What is core java used for?

1051


What do you mean by ternary operator in java?

961