How does the ternary Operator Works?

>> Tuesday, November 15, 2011

The Ternary Operator contains three operands with
  "? :". Based on the return type it will give the value.

operand1 ? operand2 : operand3

Ternary Operator Syntax:

boolean expression ? value1 : value2 ;

The first operand is a boolean expression; if the expression is true then the value of the second operand is returned otherwise the value of the third operand is returned:

Here if operand1 is true, operand2 is returned.

operand1 must be a boolean type

Read more...

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Google Bookmark Yahoo ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl

Related Posts Plugin for WordPress, Blogger...

Random Posts

JavabynataraJ - Find me on Bloggers.com Find me on blorner.com Technology Blogs JavabynataraJ Backlinks Blogarama - The Blog Directory

  © Blogger template Webnolia by Ourblogtemplates.com 2009

Back to TOP