0

Does the super class generaly have not the object?

oop concept

25th Aug 2017, 8:19 PM
KAUSHIK KUMAR
KAUSHIK KUMAR - avatar
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...
25th Aug 2017, 8:27 PM
Tashi N
Tashi N - avatar
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
25th Aug 2017, 8:34 PM
KAUSHIK KUMAR
KAUSHIK KUMAR - avatar
0
And one more thing wanted to know How to be selective when creating instance of super class to select required attributes and function.?
25th Aug 2017, 8:36 PM
KAUSHIK KUMAR
KAUSHIK KUMAR - avatar
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.
25th Aug 2017, 11:44 PM
Gunther Strauss
Gunther Strauss - avatar