Inheritance Access using Example in java

Inheritance Access using Example in java
SOURCE : InhertanceAccess.java






public class InhertanceAccess {

public void eat() {
System.out.println("inside eat");
}

static class B extends InhertanceAccess {
public void eat() {
System.out.println("inside B");

}
public static void main(String[] args) {

InhertanceAccess hs = new B();
hs.eat();

}
}
}


INPUT




OUTPUT

inside B







Sandeep Kumar D

Hi, I have written and developed this post so that most of people will be benefited. I'm committed to provide easy and in-depth tutorials on various technologies.I hope it will help you a lot.

- Sandeep Kumar D

Follow Me @Google+




SHARE

    Blogger Comment
    Facebook Comment

0 comments :

Post a Comment