LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   println question (http://www.linuxquestions.org/questions/programming-9/println-question-171598/)

AMMullan 04-18-2004 07:51 AM

println question
 
Can anyone tell me the boolean test statement for a java print() statement?

I.e. System.out.println((a == 1) ? "Hello" : "No Hello");

jlliagre 04-18-2004 08:19 AM

Your example is working, what else are you asking for ?

AMMullan 04-18-2004 08:38 AM

Sorry, I had it like the following:

System.out.println(serverName + (foo == 1) ? "Hello" : "World"), I needed to put brackets around the whole boolean statement - I got it working a minute ago :)

Thanks for your reply :D


All times are GMT -5. The time now is 03:51 PM.