0
Does the super class generaly have not the object?
oop concept
4 odpowiedzi
+ 11
Generally spoken you can also create objects of a super class. Imagine a super class Person and an extending class Student. Not every person is a student, but they exist...
0
I didn't mean that
when we write a program in real world we start with super class their attributes and function and we then started to extending these features to new subclasses for instances of super class.
Now tell me am I right or worng
0
And one more thing wanted to know
How to be selective when creating instance of super class to select required attributes and function.?
0
welcome to the world of design patterns :)
http://www.journaldev.com/1827/java-design-patterns-example-tutorial
have a look, maby this makes things more clear.
it always depends on the problem. and it is hard to answer generally speaking (IMHO).
maybe a new feature requires to extent a class but maybe a complete new class.