There are 2 classes . Class A and Class B. In Class A i declared
a variable in private. if we can access this private variable in
Class B. If yes means , how we can access ?

Answer Posted / deepak sarao

with the help of friend function u can access private of
class A in class B

Is This Answer Correct ?    5 Yes 19 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I run java?

471


What is archiving?

546


How does j2ee application work?

465


What do you understand by connector? Explain connector architecture.

491


Is tomcat a java ee?

479






How will you explain load() and get() methods?

508


What is 'applet container' ?

613


What is j2ee application?

531


What is 2 stands for in j2ee?

514


What is difference between j2ee and java?

483


What is interpreter in java?

443


I am newbie in J2EE & looking for strong basic behind each concept as, Why do we use private access specifier before each variable of type property bcoz ultimately to access it outside the class we use public method as getter & setter ? If we use getter & setter to access it outside the class so better we make variable as public so that it is easily available outside of the class... Please guide me why do we use as private ????

4973


What is single tier architecture in java?

478


What is a panel java?

545


What is component contract?

522