|
-
Jul 1st, 2003, 09:13 AM
#1
Thread Starter
Fanatic Member
If...and...then
Just trying to figure out something really basic but not having any luck finding it on Google.
How do I implement an if...and...then type statement in Java?
Thanks.
-
Jul 1st, 2003, 10:05 AM
#2
Code:
if ((x>0) && (x<=10))
{
System.out.println("x is between 0 and 10");
}
else
{
System.out.println("x is less than 0 or greater than 10");
}
For one line statments like that, you may omit the braces.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Jul 1st, 2003, 11:01 AM
#3
Thread Starter
Fanatic Member
Thanks very much, crptcblade! I knew it would be simple - but no wonder I couldn't find anything on Google...
-
Jul 2nd, 2003, 01:56 AM
#4
Go to java.sun.com and then to their basic java tutorial. It teaches you all that.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|