tag:blogger.com,1999:blog-441015367997898906.post2055467335864409693..comments2023-10-04T09:24:33.184-07:00Comments on C Programming Hub: Ternary Operator in JavaAnonymoushttp://www.blogger.com/profile/05032833716275723030noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-441015367997898906.post-7101658180619194052014-10-22T03:44:41.370-07:002014-10-22T03:44:41.370-07:00Is the Ternary Operator Just use for check Conditi...Is the Ternary Operator Just use for check Condition or doing something else ... ??<br>what is difference checking condition while we using if else and ternary operator .. !!S. Nonis Marishttps://www.blogger.com/profile/06349778859172955550noreply@blogger.comtag:blogger.com,1999:blog-441015367997898906.post-74118461074818826942014-10-22T03:34:08.949-07:002014-10-22T03:34:08.949-07:00int a = (i == 0) ? ten : 5;can do assignment with ...int a = (i == 0) ? ten : 5;<br>can do assignment with if/else like this:<br><br>// invalid:<br>int a = if (i == 0) 10; else 5;<br>This is a decent reason to use the ternary operator. If you do not have AN assignment:<br>James michelhttps://www.blogger.com/profile/06793770813231065742noreply@blogger.com