This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exam #3, Random Question (Java OCA 8 Programmer I Study Guide)

 
Saad Benbouzid
Greenhorn
Posts: 21
Chrome IntelliJ IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Following question points C as a good answer.
But don't you think static methods declared in interfaces also belong to the questions since it's written 'interface methods' (implying and including static methods, the new interface feature from Java 8) ?
And I thought static methods declared in interfaces can't be overriden, not even in an abstract class, am I false ?



Thank you for your answer.
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Saad Benbouzid wrote:And I thought static methods declared in interfaces can't be overriden, not even in an abstract class, am I false ?

You are correct! static interface methods can't be overridden in the implementation classes (just like a static/class method defined in a class).

Saad Benbouzid wrote:Following question points C as a good answer.
But don't you think static methods declared in interfaces also belong to the questions since it's written 'interface methods' (implying and including static methods, the new interface feature from Java 8) ?

I think answer option C is more a language thing than a Java thing.

Answer option C states that interface methods can be overridden with an abstract method in an abstract class that implements the interface. Which is in my opinion true as well. It would be false if the option stated that "Every interface method can be overridden with an abstract method in an abstract class that implements the interface" or "Interface methods can always be overridden with an abstract method in an abstract class that implements the interface".

Hope it helps!
Kind regards,
Roel
 
Saad Benbouzid
Greenhorn
Posts: 21
Chrome IntelliJ IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with you, but sometimes the questions state a fact without the use of "always" or "every" like it's the case for this question. And for those, some answers of the same kind of answer C (that is to say answers which sounds absolutely right) are marked as wrong answer because of an exception. And the official answer ("View Answer" popup) then says that it is false because of a particular exception (and even alerts you to stay focused, with expressions like "that's a tricky question !", "don't be fooled by the question !",...).

Once again, I agree with your answer on this one because I lengthily hesitated to tick it, but please notice that it's confusing for us as candidates to sometimes have to take into consideration every exceptions (special cases) and not to tick an answer which sounds right for 99% of the cases, and sometimes to have to ignore those particular cases and still tick the answer... :/
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Saad Benbouzid wrote:but please notice that it's confusing for us as candidates to sometimes have to take into consideration every exceptions (special cases) and not to tick an answer which sounds right for 99% of the cases, and sometimes to have to ignore those particular cases and still tick the answer... :/

It was absolutely not my intent to reprimand you. I just wanted to share my thoughts about the question (or answer) you had some doubts about. My apologies if my post came across a little bit strong.

I'm completely on your side: interpreting the (mock) exam questions can be hard and sometimes even confusing! Even for someone like me (who already took a few certification exams) it's sometimes hard to correctly assess a question and its answers. And there is also something like the "context of a question" which might add to the confusion and toughness, certainly for someone who never has taken a certification exam. You can find a nice discussion about the "context of a question" here, it's definitely worth reading.

And there's also some (really) good news: on the actual exam, each question will inform you how many correct answers you must select. And that's really helpful to decide if you need to select an answer or not. (E.g. now you didn't select answer C, but if the question had mentioned "Select 4 correct answers", you'll probably would have selected C as well)

Hope it helps!
Kind regards,
Roel
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic