About Question enthuware.ocpjp.v8.2.1088 :
Moderator: admin
-
- Posts: 5
- Joined: Wed Feb 25, 2015 4:11 pm
- Contact:
About Question enthuware.ocpjp.v8.2.1088 :
Hello,
I interpreted the question this way. It says: "aggregate features from multiple classes" so I immediately excluded inheritance, which is from a single class. While interface implementation, due to default and static method, is indeed aggregating features.
How would you argument the wrongness of my assumptions? Thank you.
I interpreted the question this way. It says: "aggregate features from multiple classes" so I immediately excluded inheritance, which is from a single class. While interface implementation, due to default and static method, is indeed aggregating features.
How would you argument the wrongness of my assumptions? Thank you.
-
- Site Admin
- Posts: 10043
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1088 :
Your argument is valid but the question says from a "strictly OO perspective". In a strict OO sense, interfaces are not supposed to contain any implementation.
In the real exam, you should observe the wording of the question and decide whether it is asking about strict OO perspective or pure Java perspective.
HTH,
Paul.
In the real exam, you should observe the wording of the question and decide whether it is asking about strict OO perspective or pure Java perspective.
HTH,
Paul.
If you like our products and services, please help us by posting your review here.
-
- Posts: 1
- Joined: Sun Jun 19, 2016 12:54 am
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1088 :
But you cannot inherit from multiple classes?
-
- Site Admin
- Posts: 10043
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1088 :
That is correct. Java doesn't allow a class to extend from multiple classes. But this question is purely from an OO perspective.
If you like our products and services, please help us by posting your review here.
-
- Posts: 11
- Joined: Wed Jun 14, 2017 3:43 am
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1088 :
So if the same question will be asked from Java perspective then
- Composition
and
- Interface implementation
will be correct answers?
Because I remember a similar question from OCA exam and there was citation from official Java documents about interfaces being the Java way of multiple inheritance.
- Composition
and
- Interface implementation
will be correct answers?
Because I remember a similar question from OCA exam and there was citation from official Java documents about interfaces being the Java way of multiple inheritance.
-
- Site Admin
- Posts: 10043
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1088 :
Yes, that is correct.
If you like our products and services, please help us by posting your review here.
-
- Posts: 25
- Joined: Sat Jun 03, 2017 4:56 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1088 :
Still this does not say anything to me about how the aggregation of features from multiple classes is related to the inheritance conceptadmin wrote:Your argument is valid but the question says from a "strictly OO perspective". In a strict OO sense, interfaces are not supposed to contain any implementation.
In the real exam, you should observe the wording of the question and decide whether it is asking about strict OO perspective or pure Java perspective.
HTH,
Paul.
-
- Site Admin
- Posts: 10043
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1088 :
When you extend a class, you do get features from that class, right? If you inherit from multiple classes (not possible in Java but possible in C++), you will get features from multiple classes in your class.
As mentioned in the text that you've quoted, "In a strict OO sense, interfaces are not supposed to contain any implementation." If there is no implementation then how will you aggregate features by implementing interfaces?
Static methods have nothing to do with OOP.
As mentioned in the text that you've quoted, "In a strict OO sense, interfaces are not supposed to contain any implementation." If there is no implementation then how will you aggregate features by implementing interfaces?
Static methods have nothing to do with OOP.
If you like our products and services, please help us by posting your review here.
-
- Posts: 25
- Joined: Sat Jun 03, 2017 4:56 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1088 :
I think I get it now, the question probably implies "when used together" in the section about the code reuse techniques. So, the meaning is that composition together with inheritance can be used to aggregate features from multiple classes.
I thought the question meant "when used individually"
I thought the question meant "when used individually"
-
- Site Admin
- Posts: 10043
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1088 :
No, not together with composition. Composition and inheritance are two different techniques and both, individually, do reuse code and aggregate features from multiple classes.
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: No registered users and 29 guests