Skip to content
Loading
  • Navjot Angra
    0
    @Amit,As U mention in code that i just create objof Class A
    But the problem when i will create  obj of Class B
    like :
    In main Class
    B obj=new b();
    ------------------- 
    obj.getmethod();
    ---------------------
    Then This part will give u error So what  Parameter u will pass then in obj.getmethod();
    0
  • Amit Gupta
    0
    This is because your method is not public, making the access specifier to public will be your expected output
    0
  • Navjot Angra
    0
    @Amit, As u said about public,then i have already tried it ,but not working.
    0