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

Difference between interface and abstract class with ex.

Answer Posted / vinoth sing

abstract class contain both abstract and non abstract methods
vs
interface can have only abstract methods.

a class implementing a interface itself a abstract class.

eg for interface

interface shape2d
{
double getArea();
}

class circle implements shape2d
{
int radius;
public double getArea()
{
return math.pi*r*r;

}
circle(int radius)
{
this.radius=radius;
}
class circledemo
{

public static void main (string args[])
{
circle c= new circle(10);
system.out.println(c.getArea());
}

}

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I want to print “hello” even before main is executed. How will you acheive that?

1077


Is void a data type?

951


Is empty .java file name a valid source file name?

1117


What are internal and external variables?

950


what is thread? What are the high-level thread states? : Java thread

1271


What are the differences between getting and load method?

1172


What is a Presistent Object?

1230


What is difference between static class and normal class?

1105


What do you understand by access specifiers in Java?

1006


What is the use of set in java?

1116


Why java is not 100% object-oriented?

1494


What are 4 pillers of object orinted programming?

1003


What are the java ide’s?

1023


When can we say that threads are not lightweight process in java?

1155


what invokes a threads run() method? : Java thread

1010