which is the ternary operator?
can you explain what the "?" and ":" do?
Type: Posts; User: Abadude
which is the ternary operator?
can you explain what the "?" and ":" do?
Can anyone tell me what the "?" and ":" mean in the following statement?
int y = (x < 100) ? (z > 1 ) ? 4 : 3 : 2;
ohhhhhhhhhhhhhhhhhhhhh I see what I did. i know it was a noob mistake, but thanks!!
--- Update ---
Now how would you be able to convert an array into a string?
Here is the code again. Does this make it easier to figure out?
public class Variable {
private double[] array;
public Variable(){
array[0] = 0.0;
well, i compiled the code many times, and there were no error messages while compiling; only while running.
While running, however, it says that their is a NullPointerException on
<array[0] =...
it just keeps prompting me to go to Debug mode, and does not provide a way to correct it, but i know that the error lies in
"public Variable(){
array[0] = 0.0;
}"
b/c that's where the debug first...
what kind of IDE are you using?
if you are using notepad, I suggest you download an IDE such as Eclipse online. They have very easy tutorials on how to use them, and it makes programming much...
Here is my partial code:
public class Variable {
private double[] array;
public Variable(){
array[0] = 0.0;
}