Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In the <a href="http://en.wikipedia.org/wiki/Method_signature" rel="nofollow noreferrer">method signature</a> (that would be "<code>public static int validNumCheck(num1,num2,num3)</code>"), you have to declare the types of the <a href="http://en.wikipedia.org/wiki/Parameter_(computer_science)#Parameters_and_arguments" rel="nofollow noreferrer">formal parameters</a>. "<code>public static int validNumCheck(int num1, int num2, int num3)</code>" should do the trick.</p> <p>However, a better design would be to make <code>validNumCheck</code> take only one parameter, and then you would call it with each of the three numbers.</p> <hr> <p>My next suggestion (having seen your updated code) is that you get a decent IDE. I just loaded it up in NetBeans and found a number of errors. In particular, the "illegal start of expression" is because you forgot a <code>}</code> in the while loop, which an IDE would have flagged immediately. After you get past "Hello world", Notepad just doesn't cut it anymore.</p> <p>I'm not going to list the corrections for every error, but keep in mind that <code>int[]</code>, <code>int</code>, <code>String[]</code>, and <code>String</code> are all different. You seem to be using them interchangeably (probably due to the amount of changes you've done to your code). Again, an IDE would flag all of these problems.</p> <hr> <p>Responding to your newest code (revision 12): You're getting closer. You seem to have used <code>MAX_TRIES</code> for two distinct purposes: the three numbers to enter, and the three chances for each number. While these two numbers are the same, it's better not to use the same constant for both. <code>NUM_INPUTS</code> and <code>MAX_TRIES</code> are what I would call them.</p> <p>And you still haven't added the missing <code>}</code> for the while loop.</p> <p>The next thing to do after fixing those would be to look at <code>if (getNumber == false)</code>. <code>getNumber</code> is a <code>String[]</code>, so this comparison is illegal. You should be getting the return value of <code>validNumCheck</code> into a variable, like:</p> <pre><code>boolean isValidNum = validNumCheck(getNumber[0]); </code></pre> <p>And also, there's no reason for <code>getNumber</code> to be an array. You only need one <code>String</code> at a time, right?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload