| Author |
need help for the If condition.
|
Joy Vergis
Ranch Hand
Joined: Sep 14, 2009
Posts: 42
|
|
Hi,
I get the output for the below program as
The value of a:0
The default value for int types is 0. So why i get output for only a.
|
 |
Mohamed Sanaulla
Bartender
Joined: Sep 08, 2007
Posts: 2925
|
|
Did you notice in your program- Both the statements print the same message
|
Mohamed Sanaulla | My Blog
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
a and b are both 0. That means that a<b is false, so the else statement is executed. And although you're printing the value of b (0) you say it's the value of a. Just check the String.>
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
Adrabi Abderrahim
Greenhorn
Joined: Jan 23, 2011
Posts: 8
|
|
hello,
Change "a" in line 9 to "b" :
to
|
 |
 |
|
|
subject: need help for the If condition.
|
|
|