Hi I will tell you with the help of a real time example.
Example: TV (Two companies A and B) Explanation: Let us consider that a company "A" wants to start a manufacturing plant for TV then it will take into the key aspects such as Volume ,picture quality etc ,some other features like these which are common to all ,then these are the set of features which are necessary for a TV. Now consider another company "B" who also wants to set a plant for TV sets, so they should also take into the consideration these key aspects i.e Volume ,Picture quality etc. But noteworthing point is that its respective companies decision how they give implementation to the key aspects because all companies have their own standards. They will set volume quality to their own specific standards also picture quality. No two companies can have same standards in real time. All these key aspects which are common to all TV sets are called an interfaces. Because these are necessary to build the product. In java perspective we can interface is a set of standard methods which different classes implement with their own logic. Now, suppose company B wants to add some extra features to his product. Then what the company will do? They will just launch another version of product in which the features in previous version are there and new features too. So, we can say that previous version was an abstract class because the new version not only contains all new features but also all features from previous one. One may ask why to make a class abstract? As already told by making a class abstract ,the extending class to this abstract class contains or inherits all the methods and by making so it not only contains all the methods but also it adds its own methods too. Thank You Regards Rahul Singh -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Naga Subrahmanyam Sent: Wednesday, October 13, 2010 4:42 PM To: Java Programming Online Training Course By Sang Shin Subject: [java programming] In which situation,we can decide the use of Abstract Class or Interface In which situation,we can decide the use of Abstract Class or Interface -- To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/javaprogrammingwithpassion?hl=en Mahindra Satyam powered IT for the 2010 FIFA World Cup(TM). To learn more, visit: www.mahindrasatyam.com/fifa/index.asp DISCLAIMER: This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated. -- To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/javaprogrammingwithpassion?hl=en
