Java ternary Operator
CyberCodes :: COMMUNITY :: Computer and Internet Zone :: Programming :: JAVA
Page 1 of 1
Java ternary Operator
Example
- Code:
int num = 0;
If (value < 100)
{
num = value;
}
else
{
num = 1000;
}
Can be achieved as:
int num = (value < 100) ? value : 1000;
princeterror- Universal Moderator
- Posts : 272
Credits : 11465
Fame : 81
Join date : 2012-06-07
Age : 33
Similar topics
» Java Swing Calculator
» [TUT] Create a Frame in Java with 2 Labels
» JAVA - ArrayList Cloning Technique
» Java = Get public IP & Send report ot email
» [TUT] Create a Frame in Java with 2 Labels
» JAVA - ArrayList Cloning Technique
» Java = Get public IP & Send report ot email
CyberCodes :: COMMUNITY :: Computer and Internet Zone :: Programming :: JAVA
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum