what is the difference b/w abstract and interface?

Answers were Sorted based on User's Feedback



what is the difference b/w abstract and interface?..

Answer / n.suresh

Abstract can,t support multiple inheritence.
Interface can suppport the multiple inheritence.

Abstract have accesbulity modifiers.
Interface have no accesbulity modifiers.

Is This Answer Correct ?    11 Yes 0 No

what is the difference b/w abstract and interface?..

Answer / bhaskar.mantrala

Interfaces are same as classes but their methods are
declared with out any body..... and definition
corresponding to that allmethods will write on
implementation class(i.e)single class.BUT
Eg:
interface interfacename
{
//Declarations only
//first method
//second method
..
..
//n-th method
//final variables
}
class classname implements interfacename
{
//Definitions of ALL methods present in interfacename
}
Abstract class also has same as interface and definitions of
all those methods may not be present in single extended class.

And we doesn't create an object to class that is abstract.

Is This Answer Correct ?    3 Yes 1 No

Post New Answer

More OOPS Interview Questions

How to Increment the value of the empid E001 for each and every employee by using the programe?

1 Answers   Accenture,


Write a program to compute for numeric grades for a course. The course records are in a file that will serve as the input file. The input file is in exactly the following format: Each line contains a student's first name, then one space, then ten quiz scores all on one line. The quiz scores are in whole number and are separated by one space. Your program will take it input from this file and sends it output to a second file. The data in the output file will be exactly the same as the data in the input file except that there will be one additional number (of type double) at the end of each line. This number will be the average of the student's ten quiz scores. Use at least one function that has file streams as all or some of its arguments.

0 Answers  


What is new keyword in oops?

0 Answers  


How do you define a class in oop?

0 Answers  


What is static in oop?

0 Answers  






which structured data type is not used in c++? 1.union 2.structure 3.string 4.boolean

2 Answers   HCL, Wipro,


What is Hashing and how is it done? Pictorial form?

2 Answers   emc2, Wipro,


What is the correct syntax for inheritance? 1) class aclass : public superclass 2) class aclass inherit superclass 3) class aclass <-superclass

6 Answers   Wipro,


can you explain how to use JavaBean in Project

3 Answers   Infosys, Satyam,


What is class encapsulation?

0 Answers  


What is overloading and its types?

0 Answers  


Why is object oriented programming so hard?

0 Answers  


Categories