Search:

Type: Posts; User: farheen_zafar1

Search: Search took 0.30 seconds.

  1. Replies
    7
    Views
    200

    Re: java inheritance

    <public class myclass1
    {
    public static void method1()
    {
    System.out.println("i am parent method");
    }
    }
    public class MyClass extends myclass1
    {
    public static void method1()
  2. Replies
    7
    Views
    200

    Re: java inheritance

    <public class parent
    {
    public void a(){
    System.out.println("i am parents method");
    }

    public class child extends parent {
    public void a()
    {
    System.out.println("i am child's method");
  3. Replies
    7
    Views
    200

    Re: java inheritance

    oh i forget to write that now consider this code
    public class parent
    {
    public void a(){
    System.out.println("i am parents method");
    }

    public class child extends parent {
    public void a()
    {
  4. Replies
    7
    Views
    200

    java inheritance

    in java if a parent class and child class has method with the same name and if an object of child class is made and method is called for that object then why the parent's method is executed ?? for...
Results 1 to 4 of 4