Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

A abstract class extending an abstract class.Super class
has both abstract and non-abstract methods.How can we
implement abstract and non-abstract mehtods? Explain with
snippet

Answer Posted / tulasi prasad

abstract class AbstractParent
{
void parentMethod1()
{
System.out.println("def of non abstract

method from parent");
}
abstract void parentMethod2();
}
abstract class AbstractChild extends

AbstractParent
{
void childMethod1()
{
System.out.println("def of non abstract

method from abstract child");
}
void parentMethod2()
{
System.out.println("def of parent abstract

method from abstract child");
}
abstract void childMethod2();
}
class ConcreteChild extends AbstractChild
{
void childMethod2()
{
System.out.println("def of child abstract

method from concrete child");
}
}
public class Test
{
public static void main(String args[])
{
ConcreteChild obj = new ConcreteChild();
obj.parentMethod1();
obj.parentMethod2();
obj.childMethod1();
obj.childMethod2();
}
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can a class be final?

896


Is array primitive data type in java?

941


what is difference betweem home interface and remote interface?

2561


Why charat is used in java?

983


How many decimal digits is 64 bit?

868


What are the five major types of reference sources?

1036


What are the different types of inheritance in java?

949


What are conditionals and its types?

1075


What is a jit compiler?

1068


What is difference between checked and unchecked exception in java?

956


Which java ide is used the most?

943


Is null == null in java?

1033


What is time complexity java?

946


Define array. Tell me about 2-D array.

996


Can you call a method in a method?

1008