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 main purpose of abstract class?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are white spaces in java?

1046


What is the benefit of lambda expressions?

1059


How many ways can an argument be passed to a subroutine and explain them?

1026


hr interview how many minutes asking question

2042


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

894


What is the use of callablestatement?

1014


Is it possible to compare various strings with the help of == operator?

991


Can we have more than one package statement in the source file?

1054


What is visibility mode?

967


What is the importance of hashcode() and equals() methods?

1054


Can a static block throw exception?

1090


What is nested class?

999


What is string immutability?

1103


Can you explain the private protected field modifier?

1028


Can we override data members in java?

1142