Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I am guessing that you are used to Pascal (or a derivative).</p> <p>public static int square(x:Integer):Integer</p> <p>in Java that is</p> <p>public static int square(int x)</p> <p>Also since the code is inside of "MyMathOpsTest" you do not need to prefix the method calls with "MyMathOpsTest.".</p> <p>Also, why call it "MyMathOps" instead of "MathOperationsTest"? Of course it is yours - it doesn't be long to me or anyone else! Pick names that have meaning, try to avoid shorthands like "Ops", unless it is common for the field you are working in (URL is a good one, "Ops" isn't).</p> <p>And now for the generl programming advice for a beginner:</p> <ul> <li>write a single line of code</li> <li>get that line of code to compile</li> <li>once that line of code compiles work on the next one</li> <li>get the next line of code to compile</li> <li>keep doing that until the program is done.</li> </ul> <p>There is no point in making the same mistakes over and over again - all you get good at is making mistakes, and that isn't much fun.</p> <p>So to get you started...</p> <p><strong>Step 1:</strong></p> <pre><code>public class MathOperations { public static int maximum(final int x, final int y, final int z) { } } </code></pre> <p>(compile the above code)</p> <p><strong>Step 2:</strong></p> <pre><code>public class MathOperations { public static int maximum(final int x, final int y, final int z) { final Scanner input; } } </code></pre> <p>(compile the above code)</p> <p><strong>Step 3:</strong></p> <pre><code>public class MathOperations { public static int maximum(final int x, final int y, final int z) { final Scanner input; intput = new Scanner(System.in); } } </code></pre> <p>(compile the above code)</p> <p>and then keep going one line at a time. Once you get the hang of it you can do more than one line, but at the start, doing it one line at a time will show you immediately when you make a mistake. Make sure that you fix ALL of the mistakes before you move on to the next line.</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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