Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Rules Roundup #108

 
Yuri Sforza
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Given x=y--; Which of these will be true AFTER execution?

x == y
x < y
x > y

Supposed answer is x>y but what about the following:


--
Y. Sforza
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
x will be -128 and y = 127, and thus, y > x would be the correct answer.
 
Yuri Sforza
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, of course. This means that there is no correct answer
(which is ALWAYS true) for the question #108.
--
Y. Sforza
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic