• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

Rules Roundup beta error

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'm totally new to the site, but I just wanted to tell ya'll how glad I am that I found it. It has made studying for my J2CP exam much easier. And I LOVE the Rules Roundup! It is one of the best quizzer utilities that I have encountered in studying for any exam.
As to the error, Question #44 counts the right answer as wrong. For reference, it asks (approximately)
Given x=y--, which is true? x<y , x==y , x>y
I answered x>y and it counted it as wrong.

-B
[ October 27, 2002: Message edited by: Brigette Anderson ]
[ October 27, 2002: Message edited by: Brigette Anderson ]
 
Sheriff
Posts: 9099
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Given x = y--;

Which of these will be true AFTER execution?

The correct answer is:

x == y

because:

y is assigned to x and THEN y is decremented.

Write a test program and try it.
 
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

When run prints:
false
true
-Barry
 
Marilyn de Queiroz
Sheriff
Posts: 9099
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah, yes
We'll have to change that.

And the reason for that is:
y is assigned to x, then y is decremented.
So by the end of the statement, x is greater than y.

Ok, I'll go get some sleep now.
[ October 28, 2002: Message edited by: Marilyn de Queiroz ]
 
I miss the old days when I would think up a sinister scheme for world domination and you would show a little emotional support. So just look at this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!