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
You have more closing braces than opening braces. Your first } should be a {.
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
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);
}
}
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).