Geek Alert: For all my Developers out there

Joined
May 8, 2012
Messages
1,161
Reputation
-5
Daps
673
Reppin
NULL
The ternary operator is the shyt saves a few lines of code

foo == null ? "": foo

replaces


if (foo == null)
foo = "";

and it can be done inline in java code, on a jsp page or in javascript

:dj2::dj2::dj2::dj2:
 

yseJ

Empire strikes back
Joined
Apr 30, 2012
Messages
45,626
Reputation
2,740
Daps
66,439
Reppin
The Yay
The ternary operator is the shyt saves a few lines of code

foo == null ? "": foo

replaces


if (foo == null)
foo = "";

and it can be done inline in java code, on a jsp page or in javascript

:dj2::dj2::dj2::dj2:
you just learned that breh ? :heh:
it doesnt really matter either...its all about readability and elegance
 
Top