Ternary Operators Def: In ternary operators we use 3 operands. syntax: expr1 ? expr2 : expr3 Note: Result of expr1 should be boolean in java. Demo: public class Ternary{ public static void main(String args[]){ //ternary operator int a=5; System.out.println( a>4 ? "a is greater than 4" : "a is less than equal to 4"); } } output is: a is greater than 4
Translate
Wednesday, 22 June 2016
Java Ternary Operator
Subscribe to:
Post Comments (Atom)
-
HII GUYS this is one of the easy problem just compute small prime number and then check which numbers are lucky number and store them in ...
-
HII GUYS this is also one of the easy problem here simply apply the brute force logic but just do that in precompute i think there is n...

No comments:
Post a Comment