From: Jano Svitok Date: 2007-11-06T19:54:33+09:00 Subject: Re: why return gives error when used with ? : On 11/6/07, Shuaib Zahda wrote: > Hi all > > in my program I am using a lot of true false conditions. So, I want to > shorten my code by using the conditional operator ? : but when I use the > word return it gives an error which i do not really know why? > > e.g. x == 5 ? return true : return false you may write it as return x == 5 ? true : false and in this case you can omit the "? true : false", because the value of x == 5 is just that. so in your case write just return x == 5 and if it is the lase statement, you can event omit the return