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


Can you call a private data from an inner class?

Answers were Sorted based on User's Feedback



Can you call a private data from an inner class?..

Answer / ejp

The question is completely meaningless. You can't 'call'
private data at all. You call _methods_.

You can _access_ private data members from anywhere in the
enclosing scope, which includes inner classes.

Is This Answer Correct ?    7 Yes 2 No

Can you call a private data from an inner class?..

Answer / sudhakar

when ever we declare a variable as private in Outer
class,that variable we can access from Inner class.

Is This Answer Correct ?    0 Yes 0 No

Can you call a private data from an inner class?..

Answer / jettimadhuchowdary

public class MainTest {
private int localPr =1;
public int localPb = 20;
protected int localPro = 3;
int localDf = 5;
/**
* @param args
*/
public static void main(String[] s) {
// TODO Auto-generated method stub
MainTest mainTest = new MainTest();
InnerClass class1 = mainTest.new InnerClass();
class1.call();
}
class InnerClass
{
void call() {
System.out.println(" display data localDf ="+ localDf);
System.out.println(" display data localPro ="+ localPro);
System.out.println(" display data localPb ="+ localPb);
System.out.println(" display data localPr ="+ localPr);
}
}

}

and the output is

display data localDf =5
display data localPro =3
display data localPb =20
display data localPr =1

Is This Answer Correct ?    0 Yes 1 No

Can you call a private data from an inner class?..

Answer / venki mic

Yes Its possible.private date can be accessible with in the
class .

Is This Answer Correct ?    0 Yes 4 No

Can you call a private data from an inner class?..

Answer / devarathnam c,kotagudibanda(po

Yes ,we can call even private data in an inner classes.

Is This Answer Correct ?    0 Yes 4 No

Can you call a private data from an inner class?..

Answer / kishore

ya,is possible

Is This Answer Correct ?    0 Yes 5 No

Post New Answer

More Core Java Interview Questions

What are the two ways to create a thread?

0 Answers  


How to override a equals() method and what is the use?

1 Answers  


Give me an example of array and linked list? Where they can be used?

0 Answers   Ericsson,


explain local datetime api in java8?

0 Answers  


Difference between array and arraylist.

23 Answers   Arise Solution, Banca Sella, iFocus, NIC, Sai Softech, Solartis, TCS, Verizon,


What is collection class in java? List down its methods and interfaces.

0 Answers  


Which method will get invoked first in a stand alone application?

1 Answers  


Addition to previous section relative word 5th one was Putrid ans: rotten, also there was prob. in 1st section on bucket weight ans:10kg, also there was a prob. on train speed to find bridge length ans:800 mtrs.

0 Answers   V2 Solutions,


they asked class A{} class B{} class c{} all the three class saved as a single file,there is no main method in the file and anothe class M.java class m { psvm(String args[]) { // here the parent class can access } }

2 Answers   DNS, IPSR Solutions,


What is the difference between @before and @beforeclass annotation?

0 Answers  


What method is used to specify a container's layout in java programming?

0 Answers  


How is abstraction implemented in java ?

0 Answers  


Categories