Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Do anyone know the reason for this error?

807600Oct 25 2007 — edited Oct 25 2007
this is the code,

public class pack
{
public static void main(String args[])
{
private int a;
a = 1000;
System.out.println("\n pack ");
System.out.println(" a is "+a);
}
}

when i compile javac pack.java......... i am getting this error,

pack.java:6: illegal start of expression
private int a;
^
1 error

i really dont know what's the reason. Can anyone throw light on this?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 22 2007
Added on Oct 25 2007
6 comments
106 views