CyberCodes
Java ternary Operator Welcome

Reminders sa mga rehistradong myembro:

•ang lengwahe na gagamitin ay pawang english at tagalog lamang

•Bawal po dito ang pakikipag away

•Bawal ang mga shorcut na mga words
Example: txt, Pwd, at iba pa

•Bawal mababastos at masasakit na salita o anu mang makakasakit
ng damdamin ng isang myembro ng forum na ito

•use the "like" button if the post of the following user you think are usefull



Join the forum, it's quick and easy

CyberCodes
Java ternary Operator Welcome

Reminders sa mga rehistradong myembro:

•ang lengwahe na gagamitin ay pawang english at tagalog lamang

•Bawal po dito ang pakikipag away

•Bawal ang mga shorcut na mga words
Example: txt, Pwd, at iba pa

•Bawal mababastos at masasakit na salita o anu mang makakasakit
ng damdamin ng isang myembro ng forum na ito

•use the "like" button if the post of the following user you think are usefull

CyberCodes
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Java ternary Operator

Go down

Java ternary Operator Empty Java ternary Operator

Post by princeterror Sat Sep 22, 2012 4:51 am

Example

Code:
int num = 0;
If (value < 100)
{
  num = value;
}
else
{
  num = 1000;
}


Can be achieved as:

int num = (value < 100) ? value : 1000;
princeterror
princeterror
Universal Moderator
Universal Moderator

Posts : 272
Credits : 11465
Fame : 81
Join date : 2012-06-07
Age : 33

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum