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...

Can a class extend abstract class or interface? why

Answer Posted / swapna

Yes, a class can extends an abstract class.A class can
implement an interface not to extend an interface.
In abstract class can consist method signature not method's
defenation. Through class we can define the methods
defenation by using public access specifier. In class we
can override the methods of abstract class by using public
access specifiers. Same think will happen in also interface
case . B'coz we cannot directly create object of abstract
class and interface.
Ex:
abstract class A
{
abstract void show();
}
class B extends A
{
public void show()
{
System.out.println ("Hello java");
}
}
public class AbstA {

public static void main (String[] args)
{
B b=new B();
b.show();
}

}
out put: Hello java

Is This Answer Correct ?    17 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is string example?

986


Difference between start() and run() method of thread class?

995


What does sprintf mean?

876


Write a code to create a trigger to call a stored procedure

907


What are filterstreams?

1016


Which arithmetic operations can result in the throwing of an arithmeticexception?

970


What must a class do to implement an interface in java programming?

966


What does you mean in math?

1009


How can the checkbox class be used to create a radio button?

979


Explain creating threads by extending thread class ?

1009


Is java a prime method?

935


State the merge-sort principle and its time complexity.

914


Which variable is the independent variable?

924


Explain static nested classes ?

1044


What is string english?

958