• Post Reply Bookmark Topic Watch Topic
  • New Topic

Legal Arguments for If Statements  RSS feed

 
Unni Kainila
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was playing a bit with an example in K&B's exam book (page 215. i think the sample in the book misses a closing paranthesis).
A slight variant of the sample is given below:

When I run this code, the output is:
true-1
true-2
true-3
I wonder why "true-4" is not printed
 
Alex Radomski
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Unni,
When I run this code it does print all four lines...
Alex

 
Faisal Khan
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Unni,
I just copied and pased that code into a test class and it does print all:
C:\tmp>java Test
true-1
true-2
true-3
true-4
C:\tmp>
 
Unni Kainila
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Friends,
Looks like my java IDE problem. It is using jdk1.3 too!
I compiled and run it from command prompt with jdk1.4.1. I got all four lines of output.
Sorry for the confusion, thanks for your help.
How do you guys test your code...command prompt? Or do you use java IDEs? (Since many IDE does not let you use the latest jdk...?)
thanks
Unni
 
Edwin Keeton
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm wondering what this has to do with which IDE you're using?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!