File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
REST with Spring (video course)
this week in the
A simple question
Joined: Nov 25, 2004
Dec 09, 2004 09:02:00
Hi,could you please let me know what the following ststement says:
theDX = theDX > MAX_V ? MAX_V : theDX;
[ December 09, 2004: Message edited by: Ernest Friedman-Hill ]
author and iconoclast
Joined: Jul 08, 2003
Dec 09, 2004 09:06:00
I edited your post to remove some superfluous formatting.
The ? and : characters together are the "ternary operator." It's basically a shorthand way of writing "if/then". Another way to write exactly the same thing would be
if (theDX > MAX_V) theDX = MAX_V else theDX = theDX;
Of course, written out like this, the "else" part is redundant.
[Jess in Action]
I agree. Here's the link:
subject: A simple question
break statement question
Programmatically set the knob position of a JScrollBar
Needed Info about FooCo..Urgent
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015