what is main purpose of abstract class?

Answers were Sorted based on User's Feedback



what is main purpose of abstract class?..

Answer / amit patel

Abstract class is used to implement common behavior which is
required by all subclasses but have some behavior which is
specific to subclass.

E.g., you want to implement a DocumentViewer App. Basic
operations are like open, view and close. open and close
requires no specific implementation while view require
specific implementation. Make DocumentViewer abstract,
implement open, close and make view as abstract. Now view is
responsibility of subclass. Like PDFViewer will have own
implementation for view()

Is This Answer Correct ?    14 Yes 1 No

what is main purpose of abstract class?..

Answer / rakesh@crr

if a class contains abstract method,that class must be
declared as a abstract class. abstract methods contains only
declarations. it does not contain objects.

Is This Answer Correct ?    16 Yes 12 No

what is main purpose of abstract class?..

Answer / surendra

Abstract classes are use to give functionality to the users.
The functionality is given by the class, use use this
functionality as per his/her requirements. Abstract classes
gives additional functionality to put one or two methods
common for each user and may put others abstract to fullfill
users requirements.

Is This Answer Correct ?    5 Yes 2 No

what is main purpose of abstract class?..

Answer / sumanth gatla

there is no rule that an abstract class must contain one
abstract method. with out single abstract method also
abstract class exist
eg........HTTPServlet

Is This Answer Correct ?    0 Yes 0 No

what is main purpose of abstract class?..

Answer / vishu

abstract class caontains only abstract mehtods all methods
that have to define before they are decalring in the next
class

& we dosn't create object of the abstract class

Is This Answer Correct ?    2 Yes 5 No

what is main purpose of abstract class?..

Answer / harshavardhan

In Inheritance , class become more general and more
abstract.Ancestor classes are more general, i.e more basis
for other classes.Abstract classes can have fields and
concrete methods.Methods are declared not defined so we can
not create objects. but we can create object variables of an
abstract class. but such variable must refer to an object of
a nonabstract subclass.

Is This Answer Correct ?    0 Yes 4 No

what is main purpose of abstract class?..

Answer / venkatesh

abstract class have atleast abstract method
it is maily used for to prevent create object of class.

Is This Answer Correct ?    2 Yes 8 No

Post New Answer

More Core Java Interview Questions

What will happens if you opened Internet Explorer 4 times?

2 Answers  


Differentiate constructor and a method and how are it be used?

7 Answers   Wipro,


Give few difference between constructor and method?

0 Answers  


What is string and its types?

0 Answers  


How you can force the garbage collection?

0 Answers  






What are three advantages of using functions?

0 Answers  


what is a working thread? : Java thread

0 Answers  


How can we find size of the object ?

5 Answers   CTS, RazorSight,


suppose in a class there is a code like this: { Set hs=new Hashset(); hs.add(new Emp("kathy",1000)); hs.add(new Emp("kathy",2000)); } how can u avoid the above code in your class as set won't allow duplicate objects?

3 Answers  


What are new features introduced with java 8 ?

0 Answers  


what is singleton in java?

0 Answers   IBS,


INTERVIEW QUESTION FOR ANDROID

0 Answers  


Categories