Hi friends during my interview one interviewer ask me about abstract Class i have him give answer
and the he just said the ok please tell me the real use of it. at that time i am not able to answer him
Please give me some example so that i can give them real world project scenario in my next interview
Please help me my friends thank in advance i am waiting for answer
Iftikar HussainPosted Jul 8, 2013, 11:48 AM
Please refer the below link. You will get idea about abstract class and when it need to be used.
http://www.codeproject.com/Articles/6118/All-about-abstract-classes
http://www.javacoffeebreak.com/faq/faq0084.html
Regards,
Iftikar
Chandradev PrasadPosted Jul 8, 2013, 8:43 AM
1. If we have created some method and we want to modify some methods with new feature and we have to use somewhere then we can use abstract class
2. If we are developing some product type project, where we have to keep on adding new features in coming days then we can use abstract class.
Sunny SharmaPosted Jun 22, 2013, 2:59 PM
Refer to this post and read it carefully, this answers your question:
http://www.headspring.com/two-reasons-to-use-abstract-classes-in-c/
Also, you may want to Google it.
"Basically, Abstract classes help you improve your code not only through what they can do, but also through what they can't. They can hold common features for many classes to inherit, without accidentally becoming objects themselves. They can also force you to write unique implementations of a common method, preventing human errors of forgetfulness. When you set up a class hierarchy, seriously consider whether you need a normal class to inherit from, or whether an abstract class will do. It may end up making the difference between a solid or buggy program."
Mark it as answer if it helps.
Cheers!