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

Error on Enthuware Mock Exam

 
Jared Tse
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am in the process of studying for Java 8 OCA Exam, and I notice an error on the Enthuware mock tests, and I want to cross check it with you if this is a valid or acctually a bug.

I have tested it on my local set up and it's correct but the Mock says is incorrect.




Refer to the image attached for more info

Thanks
Screen Shot 2016-03-18 at 15.48.40.png
[Thumbnail for Screen Shot 2016-03-18 at 15.48.40.png]
 
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
Hi Jared Tse,

First of all, a warm welcome to CodeRanch!

Jared Tse wrote:I am in the process of studying for Java 8 OCA Exam, and I notice an error on the Enthuware mock tests, and I want to cross check it with you if this is a valid or acctually a bug.

I have tested it on my local set up and it's correct but the Mock says is incorrect.

The Enthuware mock question is correct and you are incorrect! And if you probably read the question again (maybe a bit more carefully), you'll probably know why. The question asks to select all methods which will correctly overload the given method. And this is the given methodThe first option you have selected is indeed a correct overload of this method, because it has the same number of parameters (3) but the order is different resulting in a different method signature and thus a valid method overload.

This is the second option you have selectedThis method has the same number of parameters (3) and also the same order of parameters (int, int, float). So this method has exactly the same method signature as the given method and therefore it's not a valid method overload. If you would add both methods to the same class, you'll get a compiler error. And that's why option C is an incorrect answer. Please note that the name of parameters do not matter (as they are not part of the method signature).

Hope it helps!
Kind regards,
Roel
 
Jared Tse
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI Roel De Nijs

Yes, it makes sense now, I missed the part where the two methods do actually reside in the same Java file. Lesson learned.

Thanks
 
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
Jared Tse wrote:Yes, it makes sense now, I missed the part where the two methods do actually reside in the same Java file. Lesson learned.

And that's why mock exams exist! It's better to make that mistake during a mock exam than during the actual exam
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic