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...

There can be a abstract class without abstract methods, but
what is the need to declare a class abstract if it doesn't
contain abstract methods?

Answer Posted / gkp

Abstract class and Interface are the design time decision. As we expect to extend our implementation in future so we need to give space to incorporate new implementation. As we know if some implementation of a method will be common in many classes then that method should be moved to abstract class so the repetition of same code can be avoided. Even though we don't have any abstract method in our abstract class, we can go for a abstract class. Generally in design of java classes, it is designed like, first an interface then an abstract class and then concrete class implementation starts.

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the advantages of functions?

921


Write a java program to count the number of words present in a string?

984


What is the function of static in java?

1082


What is the purpose of javac exe?

1098


When should I use a singleton?

1050


how can you catch multiple exceptions in java?

1019


What best practices should you follow while writing multithreaded code in java?

1077


What is a method in java?

1055


Tell me about your ability to work under pressure

2198


What is the difference between stringbuffer and stringbuilder?

1063


What is default switch case? Give example.

1010


How to stop a thread in java? Explain about sleep () method in a thread?

1015


Can an interface have a class?

1002


What should I import for arraylist in java?

1043


What is super constructor?

1000