Hi,
I would like to know about this code specifically the bold ones.
myrecords is declared as ResultSet... :) :) :)Code:for(int i = 1; i<=3; i++)
{
System.out.print((i>1 ? ", " : " ") + myrecords.getString(i));
}
Printable View
Hi,
I would like to know about this code specifically the bold ones.
myrecords is declared as ResultSet... :) :) :)Code:for(int i = 1; i<=3; i++)
{
System.out.print((i>1 ? ", " : " ") + myrecords.getString(i));
}
What do you want to know about it?
Every time the print is called "i" is tested if >1 ',' will be printed before the ResultSet.getString(i) otherwise (i<=1) an empty string will be printed instead
Hi,
Is this similar to vb's IIf() function? Based on your explanation, the ", " is the true statement? and " " or empty string is the false statement? Hmmm, Im just new to java database and am curious with this things, anyway I also started to like java...
:) :) :)
It's exactly the same, yes.
Keep on with java, you'll love it ;)
Ok,
Thanks for your help..I'll be posting more on java soon enough..
:) :) :)
Greg
Not exactly, but close enough. With VB's IIf(), both the true part and the false part will be evaluated before getting passed into IIf(). So if you are trying to do a check for Nothing before accessing an object's properties, IIf will still throw an exception.Quote:
Originally Posted by ComputerJy
In Java, the false part is only evaluated if the test indeed returns false.
Hi,
Thanks for the enlightenment...
:) :) :)