Difference between interface and abstract class?

Answers were Sorted based on User's Feedback



Difference between interface and abstract class? ..

Answer / jenypatel86

There is no difference in the functionality of these two.The
only difference is that a class cannot extend an abstract
class if it already is extending some other class.An interface
on the other hand can be implemented in any situation which
makes them very powerful.Also user defined exceptions can be
defined within an interface itself, which is not the case with
an abstract class.

Is This Answer Correct ?    6 Yes 0 No

Difference between interface and abstract class? ..

Answer / m.shanmuga sundaram rjnsoftwar

There are some subtle differences between an abstract class
and an interface

1)
A class can inherit multiple interfaces
A class can inherit only one abstract class

2)
An interface does not contain any access specifier,fields
and code. By default the access specifier is public.

An abstract class can contain any access specifier,fields
and code.

Is This Answer Correct ?    4 Yes 2 No

Post New Answer

More Programming Languages AllOther Interview Questions

When will you use shell script/Perl ahead of C/C++?

0 Answers   Yahoo,


How to set on/off a group of indicators in a single statement?

0 Answers  


What binary value will be internally stored for NULL for the type S9(1) COMP 3 in mainframe

0 Answers  


Hi Friends , i am very new in VB 6.0 Any body can able to help me ? i need interview question and answer vb 6.0 . please send honeysukumar@yhaoo.com

2 Answers  


in a VB application, where the data will be stored after manipulation? what is the syntax for that?

0 Answers   TCS,






iam confused among testing ,.net and java. can anybody help me.

0 Answers  


could u please also write an example of a code that involves instances from an abstract class just as u did for interfaces because u said it could also work which i really doubt. thanks

0 Answers  


WS-NUM PIC S9(05)V(02) SIGN TRAILING SEPARATE MOVE '0050000+' TO WS-NUM The value stored is 00500,00+ MOVE '0050000-' TO WS-NUM Then what is the value will be stored in WS-NUM? Am getting '-00500,00'.....>>> What should I declare to WS-NUM so that I can get correct values for both + & - signs.

0 Answers  


Given a set. Write the pseudo code to get all the subsets for the given set. Eg. Input : {1,2} Output : (),(1),(2),(1,2)

0 Answers   Goldman Sachs,


how can we get version of database ?

1 Answers  


WHAT IS THE MEANING OF CONSTANT ...EXEEDS LENGTH LIMIT WHILE COPYING FROM PS FILE TO KSDS

0 Answers  


In Java what is the difference between following two statements ? int a[],b; int []a,b;

1 Answers  


Categories