About Question enthuware.ocajp.i.v7.2.1205 :
Moderator: admin
-
- Posts: 22
- Joined: Sun Nov 18, 2012 1:51 am
- Location: Moscow
- Contact:
About Question enthuware.ocajp.i.v7.2.1205 :
1st wrong answer: Interfaces permit multiple implementation inheritance.
Explanation: Interfaces do not contain any implementations and only permit multiple interface inheritance.
My native language is not English, probably it is the reason why I can't understand the explanation.
The explanations consists of two parts:
1) Interfaces do not contain any implementations
2) Interfaces permit multiple interface inheritance.
Part 2 is exactly the ansewer. So why is it wrong?
Explanation: Interfaces do not contain any implementations and only permit multiple interface inheritance.
My native language is not English, probably it is the reason why I can't understand the explanation.
The explanations consists of two parts:
1) Interfaces do not contain any implementations
2) Interfaces permit multiple interface inheritance.
Part 2 is exactly the ansewer. So why is it wrong?
-
- Posts: 22
- Joined: Sun Nov 18, 2012 1:51 am
- Location: Moscow
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1205 :
Also I can't understand why 2nd answer is correct:
"Unlike a class, an interface can extend from multiple interfaces."
but a class can also implement multiple interfaces
"Unlike a class, an interface can extend from multiple interfaces."
but a class can also implement multiple interfaces
-
- Site Admin
- Posts: 10053
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1205 :
1. There is a difference between the option statement and the explanation. Option says "implementation inheritance" and while the explanation says, "interface inheritance". That is why the option is wrong. Interfaces do not contain/inherit implementations.
2. 2nd option is correct because an interface can extend from multiple interface while a class cannot extend from interface(s), it implements them.
HTH,
Paul
2. 2nd option is correct because an interface can extend from multiple interface while a class cannot extend from interface(s), it implements them.
HTH,
Paul
If you like our products and services, please help us by posting your review here.
-
- Posts: 22
- Joined: Sun Nov 18, 2012 1:51 am
- Location: Moscow
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1205 :
Paul, thank you for your patience very much, it is clear now ...
-
- Posts: 15
- Joined: Thu Sep 10, 2015 3:50 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1205 :
Hi, I have a doubt in the explanation.
"Variables in interfaces are always static and method prototypes in interfaces can never be static."
I agree variables are always static.
But method prototypes in interfaces can never be static is confusing.
Since in Oracle docs, The interface body can contain abstract methods, default methods, and static methods.
So how can we say method can never be static?
"Variables in interfaces are always static and method prototypes in interfaces can never be static."
I agree variables are always static.
But method prototypes in interfaces can never be static is confusing.
Since in Oracle docs, The interface body can contain abstract methods, default methods, and static methods.
So how can we say method can never be static?
-
- Site Admin
- Posts: 10053
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1205 :
In Java 8, interfaces can have static and default methods. Not in Java 7.
If you like our products and services, please help us by posting your review here.
-
- Posts: 15
- Joined: Thu Sep 10, 2015 3:50 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1205 :
So, the exam is based on Java 7, should be keep only abstract methods in the exam if asked about methods of interfaces are implicitly?
-
- Site Admin
- Posts: 10053
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1205 :
Yes, exams 803 and 804 are based on java 7.
If you like our products and services, please help us by posting your review here.
-
- Posts: 15
- Joined: Thu Sep 10, 2015 3:50 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1205 :
Hi My question is about the answer which we should keep for the interface methods? Please respond
-
- Site Admin
- Posts: 10053
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1205 :
I am not sure I understand your confusion. If you are taking exams 803 or 804, you need to remember that an interface can only contain abstract methods and static fields. It cannot contain default methods and static methods. In other words, all methods of an interface must be abstract.
-Paul.
-Paul.
If you like our products and services, please help us by posting your review here.
-
- Posts: 1
- Joined: Thu Jul 14, 2016 4:30 am
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1205 :
Members of an interface may be static.
"may be" confuse me .
Members of an interface are static!
"may be" confuse me .
Members of an interface are static!
-
- Site Admin
- Posts: 10053
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1205 :
Methods of an interface are not static.(In Java 8, they may be static as well).
If you like our products and services, please help us by posting your review here.
-
- Posts: 22
- Joined: Sat Jun 30, 2018 6:11 am
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1205 :
"may be " means that also "may be not"
Who is online
Users browsing this forum: Bing [Bot] and 48 guests