• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 21
IntelliJ IDE Oracle Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
IntelliJ IDE Oracle Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic