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...

why i can not access private variable in other class?

Answer Posted / srihari

private variables are visible within the class they are
defined but not in the other classes present in same package
& classes in different packages. Hence, we call "private"
variables as "CLASS-LEVEL" instances.

private variables are used when we do not want the variable
declared in a class to be shared or used by other classes
present in same packages or different packages.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we need new date and time api in java se 8?

901


Where are group policies stored? : java security

841


What is a cookie in java?

946


What is savepoint in java?

855


What is singleton pattern in java?

849


What is an actionevent in java?

993


How do I run a project in eclipse?

947


Can the main method be overloaded?

964


Can I have multiple main methods in the same class?

896


What are struts java?

906


What is a stream in programming?

853


What is a delimiter in java?

891


What is entitymanager in java?

1009


What is the use of rs next () in java?

900


What is gwt in java?

912