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

What is stateful in java?

1028


Why is javac not recognized?

940


What is an api in java?

1128


What are the advantages of lambda functions?

1028


Can java program run without jdk?

972


What are the benefits of a jar file?

1073


What is rxjava2?

935


What does el mean in java?

1082


Which is better openjdk or oracle jdk?

930


What are the advantages of java sockets?

1203


Are the actual permissions for the application defined at run-time or compile-time? : java security

999


What is a singleton in java?

1036


If you’re overriding the method equals() of an object, which other method you might also consider?

1003


What do you understand by downcasting?

978


What is flatmap java?

1060