Wednesday, May 2, 2012

compilation error in java "stray '@' in program"

i am trying to submit a java program in codechef. I successfully compiled it and ran it using netbeans. But when i submit the code by uploading the corresponding .java file... it comes up like this...

prog.cpp:41: error: stray '@' in program prog.cpp:4: error: 'import' does not name a type prog.cpp:7: error: expected unqualified-id before 'public'

my java program starts like this....

import java.util.Scanner;

public class jewels{
static int CNT=0;
static String q,qq;

and so on....

Should i write any package name... or still i should rather change some thing....???

Please help... :)

@Jon Skeet... u were ... I got the error... Sorry for that.. I was submitting it as a C++ file.
but now i am getting the new one... class jewels is public, should be declared in a file named public class jewels{ ^ 1 error

although i uploaded the file...
please help...

No comments:

Post a Comment