public class MyMainClass{
public static void main(String args[])
{
MySubClass mySubClass=new MySubClass();
System.out.println(mySubClass.getPrivateMethod());
}
}
class MySubClass {
private String myPrivateMethod(){
return "Aravind Sankaran";
}
public String getPrivateMethod(){
return myPrivateMethod();
}
}
Output:
Aravind Sankaran
public static void main(String args[])
{
MySubClass mySubClass=new MySubClass();
System.out.println(mySubClass.getPrivateMethod());
}
}
class MySubClass {
private String myPrivateMethod(){
return "Aravind Sankaran";
}
public String getPrivateMethod(){
return myPrivateMethod();
}
}
Output:
Aravind Sankaran
No comments:
Post a Comment