Java Beginners

Moderators: zibadian
Number of threads: 1233
Number of posts: 2675

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Issue with expressions, and or not Posted by stoner1916 on 17 Sept 2012 at 5:11 PM
f(j==0){
brick.setFillColor(Color.red);
}else if (j==1){
brick.setFillColor(Color.red);

is it possible to use the and or and not type questions on numbers, or can they only be used as true/false

i.e I'd like to be able to say in java code

if the int j is equal to 0 or 1, colour the brick red
but I can only seem to use ==, I'd can use less than or equal too 1 because there are more conditions that will contradict that later

As is stands I have to put in the case for each value of j from 0 to 9.

thank you all




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.