File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

need help for the If condition.

 
Joy Vergis
Ranch Hand
Posts: 54
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Saloon Keeper
Pie
Posts: 3159
33
Google App Engine Java Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you notice in your program- Both the statements print the same message
 
Rob Spoor
Sheriff
Pie
Posts: 20380
46
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.>
 
Adrabi Abderrahim
Greenhorn
Posts: 8
Eclipse IDE Fedora Opera
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,

Change "a" in line 9 to "b" :

to
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic