
private member of a class can be used in its public function?? if yes tha how?

Yes, you can used the private member of a class in a public function.But private modifier does not allow to access the private member of a class in another class.
class PrivateModifier {
private int x=10;
private int y=5;
public void getdata()
{
System.out.println(x);
System.out.println(y);
}
public static void main(String[]args){
PrivateModifier p=new PrivateModifier();
p.getdata();
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.