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


what is difference between interface and abstract class..?

Answers were Sorted based on User's Feedback



what is difference between interface and abstract class..?..

Answer / vinod kumar

Abstract: The members of abstract class is implemented
immediately in next class and the methods of abstract class
is blank.. as follows
abstract clas A
{
static void example();
static void ex1();
}
Interface: interface class can be implemented in other
program also....

Is This Answer Correct ?    8 Yes 2 No

what is difference between interface and abstract class..?..

Answer / vamsi

Abstract method means means it does n't have any
implementation.

Interface contains 0 or more abstract methods

Abstract class contains abstract methods as well as general
methods.
If any of any of the class that extends the abstract class
does n't implement some of the methods , it will be marked
as abstract.

Is This Answer Correct ?    4 Yes 1 No

what is difference between interface and abstract class..?..

Answer / kumar

Interface:
1)It will contain only abstract methods

Abstract Class:
1)Any class can be declared an abstract class ,but if a
class contains an abstract method it should be declared as
an abstract class.

Is This Answer Correct ?    3 Yes 0 No

what is difference between interface and abstract class..?..

Answer / nipun advinder

Interface:
1)In interface you cannot provide any implementations of
any function.
2)you must give implementations for all the methods of an
interface if you implement it in a class
3)cannot have private method
4)Scenario to use it would be to separate out the
implementation from the api

Abstract Class:
1)In interface you can provide implementations of any
function but at least one function should be abstract.
2)you must give implementations for all the abstract
methods of a abstract class if you extend it in a class
3)can have private method
4)Scenario to use it would be to denote is as a generalized
class which could provide some common functionality and you
want that it cannot be instantiated instead more
specialized forms are used.

eg abstract class account
class savingsaccount extends account
class currentaccount extends account

In this scenario assume that class account cannot provide
the complete functionality alone but contain some standard
ones.

Is This Answer Correct ?    3 Yes 1 No

Post New Answer

More Core Java Interview Questions

What is the destroy method?

0 Answers  


When will we use them?

0 Answers  


Is simpledateformat safe to use in the multithreaded program?

0 Answers  


What is a lock or purpose of locks in java?

0 Answers  


Explain the scope of a variable.

0 Answers   TCS,


Can we print null in java?

0 Answers  


I want to re-reach and use an object once it has been garbage collected. How it's possible?

0 Answers  


Does java set allow duplicates?

0 Answers  


What is the most important feature of java? What is an interface?

0 Answers  


Describe method overriding

0 Answers  


How do you make an arraylist empty in java?

0 Answers  


What are keywords and reserved words in java?

0 Answers  


Categories