posted 14 years ago
Hi Mr.Wouter, I understood the concept you were explaining somewhat, I will describe you a scenario where I will extend and create object depending on the situation.
Suppose that I am having a class called Validate which consists the methods for validating a mobile number, email ID, price, user name.
I will create an object for the Validate class in the classes in which input fields need to be validated.
Now for suppose in one class I want to validate an email ID, but the domain names must be only gmail, yahoo, aol etc. So I can't use the validate email Id method of Validate class, so what I will do is I will create another class named ValidateExtended which extends Validate class
Now I ll create object for ValidateExtended class where I want to use the second type of validateEmail(String) method.
Is my approach right one?
Thank you all in advance.
Love all, trust a few, do wrong to none.