Home java & lt; Identifier & gt; EXPECTED

& lt; Identifier & gt; EXPECTED

Author

Date

Category

Compiler issues

ex5.java:10: error: & lt; imententifier & gt; Expected
    test.maxnum (MAS1);
          ^
ex5.java:10: Error: & lt; Identifier & gt; Expected
    test.maxnum (MAS1);
            ^
ex5.java:11: Error: & lt; Identifier & gt; Expected
    test.minnum (MAS1);
          ^
ex5.java:11: Error: & lt; Identifier & gt; Expected
    test.minnum (MAS1);
            ^
ex5.java:12: Error: & LT; Identifier & GT; Expected
    test.avrnum (MAS1);
          ^
ex5.java:12: Error: & LT; Identifier & GT; Expected
    test.avrnum (MAS1);

Answer 1, Authority 100%

In the body of the class can only be announcements. The code must be inside the methods.

class ex5 {
  Public Static Void Main (String [] Args) {
    int [] MAS1 = NEW INT [5];
    For (int i = 0; i & lt; mas1.length; i ++) {
      MAS1 [i] = (int) (math.random () * 10);
      System.Out.print (MAS1 [I]);
    }
    EX5HELPER TEST = NEW EX5HELPER ();
    test.maxnum (MAS1);
    test.minnum (MAS1);
    test.avrnum (MAS1);
  }
}

If you comply with formatting, it would be easy to notice the problem.

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions