whats is inheritance?

Answer Posted / priyabrata patro

inheritance , name only mentions here that inherit.Listen inherit means it can be occupied by another one like father properties go to his sons, observer some automobiles you can get inheritance meaning there only ,like hero honda passion and passion plus , so , there are a lot of instance available which are related to inheritance.
So, inheritance is nothing but ,in programming language, occupying the properties of one class by another class.
for instance
public class Idemo{
public staic void m(){}
public void m1(){}
}
public class Idemo1 extends Idemo
{
public static void main(String args[]){
Idemo1 i=new Idemo1();
i.m();
i.m1();
}
}
but here it can not be called as inheritance
interface I{void fun1()}
interface I1
{void fun();}
interface I2 extends I,I1
{}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why stringbuilder is not thread safe?

545


what is the volatile modifier for? : Java thread

523


What ide should I use for java?

496


Is 64bit faster than 32 bit?

584


How do you convert bytes to character in java?

539






How can an object be unreferenced?

545


What is bigger kb or mb?

590


How to call one constructor from the other constructor ?

609


What is a finally block? Is there a case when finally will not execute?

553


How to reverse string in java?

619


how to deploy tomcatserver to weblogic server? write d following steps?

1455


What is JDBC Driver interface?How can you retrieve data from the ResultSet

1515


Why webdriver is an interface?

587


What the difference is between execute, execute Query, execute Update?

378


What is string length in java?

495