Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Boolean help
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
romantic_programmer




PostPosted: Wed Jan 10, 2007 3:54 pm   Post subject: Boolean help

I am Still new to java and don't under stand to to get booleans to work. if some one gold give me an example with it in an if statement i would greatly appreciate it. I looked in the tutorials and i seen examples but still cant see how it works...

Thank you...
Romantic Programmer
Sponsor
Sponsor
Sponsor
sponsor
ericfourfour




PostPosted: Wed Jan 10, 2007 9:29 pm   Post subject: Re: Boolean help

I'll provide you with a few examples of situations where booleans are used.

Java:
boolean experiment () {
    boolean status = false;
    status = true;
    if (status) {

    }
    while (!status) {

    }
    status = "Hello".equals("World");
    status = 1 == 1;
    status = 5.2 > 10.21;
    status ? 5 : 3;
    System.out.println (status);
    return status;
}


Finally, you could always google boolean and I bet you will be provided with many tutorials on booleans.
romantic_programmer




PostPosted: Sun Jan 14, 2007 4:38 pm   Post subject: RE:Boolean help

thank you, This is a great example... very helpful...
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: