#273 problems compiling

closed
Other (56)
5
2011-05-20
2011-05-05
Andy Green
No

I have just started programming and following the tutorials. the first lesson has stumped me. It shows how to create a short program to say hello.
the problem is as follows:-
I've typed in:
public class Varibles
{
public static void main(String[] args)
}
int myInteger = 5;
System.out.println(myInteger);
}
}

and i get the following errors
File: C:\Users\Andy\javavideotutes\hello.java [line: 3]
Error: C:\Users\Andy\javavideotutes\hello.java:3: ';' expected
File: C:\Users\Andy\javavideotutes\hello.java [line: 5]
Error: C:\Users\Andy\javavideotutes\hello.java:5: class, interface, or enum expected
Error: C:\Users\Andy\javavideotutes\hello.java:6: class, interface, or enum expected
File: C:\Users\Andy\javavideotutes\hello.java [line: 7]
Error: C:\Users\Andy\javavideotutes\hello.java:7: class, interface, or enum expected
__________

also I am not getting the braces automaticly I don't know if you can help me with that

regards

Andy Green

Discussion

  • Andy Green
    Andy Green
    2011-05-05

     
    Attachments
  • Mathias Ricken
    Mathias Ricken
    2011-05-05

    You have more closing braces than opening braces. Your first } should be a {.

     
  • Mathias Ricken
    Mathias Ricken
    2011-05-05

    • status: open --> pending
     
  • Andy Green
    Andy Green
    2011-05-05

    I have downloaded your file but it still comes up with errors:
    4 errors found:
    File: D:\varibles.java [line: 3]
    Error: D:\varibles.java:3: ';' expected
    File: D:\varibles.java [line: 5]
    Error: D:\varibles.java:5: class, interface, or enum expected
    File: D:\varibles.java [line: 6]
    Error: D:\varibles.java:6: class, interface, or enum expected
    File: D:\varibles.java [line: 7]
    Error: D:\varibles.java:7: class, interface, or enum expected

     
  • Andy Green
    Andy Green
    2011-05-05

    • status: pending --> open
     
  • Mathias Ricken
    Mathias Ricken
    2011-05-06

    • labels: 400076 --> Other
    • assigned_to: nobody --> mgricken
    • status: open --> pending
     
  • Mathias Ricken
    Mathias Ricken
    2011-05-06

    I didn't upload a file, you did. If you make the corrections I described, it works for me.

    This is what you want:

    /////////////////////////////////

    public class Varibles
    {
    public static void main(String[] args)
    { // <---- this needs to be a { not a } like in your code
    int myInteger = 5;
    System.out.println(myInteger);
    }
    }

     
    • status: pending --> closed
     
  • This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).