Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Inquisition Quiz related query

 
Kshitija Mitter
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,



The correct answer listed is Compilation fails.
But I dont see any problem in the code. It compiles fine and gives null as the answer...
[Hope this is the correct forum for discussing the inquisition related problems]
 
Swapnil Sonawane
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Surprisingly, compiles on my Java SDK 5.0
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15207
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is that quiz for Java 1.4 or for Java 5 or newer? This would not compile on Java 1.4, because the "..." (variable number of arguments) is a new feature of Java 5.

On Java 5 or newer it compiles and works without problems and produces null. It's possible that the test contains an error.
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As Jesper pointed this out, JDK 1.4 does not allow that syntax.

What version of the exam is the mock exam for and how was the question framed ?
 
Kshitija Mitter
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is for SCJP 5 quiz...
[ June 05, 2008: Message edited by: Kshitija Mitter ]
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Kshitija Mitter:
It is for SCJP 5 quiz...

[ June 05, 2008: Message edited by: Kshitija Mitter ]


ah ! then this question must be corrected. Try contacting the author about it
 
Matt Russell
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, my fault -- Mark (the author of those questions) sent me a correction for this a fair while back but I overlooked it. It'll be fixed pretty soon.
 
Matt Russell
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just to follow up, this is now fixed in the latest version of Inquisition.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic