| | |
Conditional Expression in JAVA
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
no you can't, at least not in that form.
The conditional expression returns a value, it cannot terminate a method.
Instead you would use
The conditional expression returns a value, it cannot terminate a method.
Instead you would use
Java Syntax (Toggle Plain Text)
return (a==2)?4:5;
![]() |
Similar Threads
- Java to Assembly (Assembly)
- Java newbie needs help with arrays (Java)
- Conditional Expression (Python)
- Error compiling complex.cpp (C++)
Other Threads in the Java Forum
- Previous Thread: DNS: TRACERT , Java Network Programming
- Next Thread: Document.insertString(); not working
Views: 9965 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for Java
actionlistener android api apple applet application arguments array arrays automation binary bluetooth character chat class classes client code component consumer database desktop draw eclipse encode error event exception file fractal ftp game givemetehcodez graphics gui helpwithhomework html ide image input integer j2me java javac javaee javaprojects jmf jni jpanel julia linked linux list loop mac map method methods mobile netbeans newbie number object online oracle print printf problem program programming project properties recursion researchinmotion rotatetext rsa scanner score screen server set size sms socket sort sql string swing template test threads time title transfer tree tutorial-sample update windows working xstream






