when,where and how to use abstract class and interface

Answer Posted / prapanch

if the developer wants some methods which are implemented
in the super class and some methods which will be
implementd by him then he will go for abstract class.
because in abstact class all methods need not to be abstact
in nature. but in interface all the methods must be
abstract and so the developer will not get any implemented
code from the interface. you will use interfaces when two
different teams are working for a same requirement then an
interface will act like a medium with which they can
interact and all the teams will be in line.so your team and
other team will implement the same method names but with
difffeerent implementation code.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is remote method invocation (rmi)?

615


how to write a server program and sending the mails to the server using smtp protocol please help me

1551


These static constructors are correct ? class A { statc intA() { } static A(int x,int y) { } static A(int x) { } }

599


Does it matter in what order catch statements for filenotfoundexception and ioexception are written?

506


What is bitwise complement?

502






What is the right data type to represent a price in java?

572


What are the uses of java?

571


What about main thread in java?

650


What is the purpose of a default constructor?

580


How to use string tokenizer class.

622


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

598


How will you compute size of a structure?

590


is there a separate stack for each thread in java? : Java thread

540


How do I find and replace in word?

533


How do you sort in descending order in java using collections sort?

498