Community
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Class names error

 
Post new topic   Reply to topic    Community Forum Index -> Java
View previous topic :: View next topic  
Author Message
cchris



Joined: 10 May 2012
Posts: 1

PostPosted: Thu May 10, 2012 3:57 am    Post subject: Class names error Reply with quote

Hi, i'm getting this error in textpad whenever I compile my program.
error: Class names, 'uncheked', are only accepted if annotation processing is explicitly requested


/*
Chris#02
Date: 12/6/2011
Description: Lesson 25 project
*/
import java.util.*;
import java.io.*;

class AlphNames
{
public static void main( String args[ ] ) throws IOException
{
System.out.println("Chris #02\n");
Scanner sf = new Scanner(new File("U:\\My Documents\\Computer Science I - Student Folders\\Lesson25\\Names.in"));

int maxIndx = -1;
String text[] = new String[1000];
while(sf.hasNext())
{
maxIndx++;
text[maxIndx] = sf.nextLine();
//System.out.println(text[maxIndx]);//for testing
}
String reversedNames[] = new String [maxIndx+1];
for(int x=0; x<=maxIndx; x++)
{
Scanner sc = new Scanner(text[x]);
String fN = sc.next(), lN = sc.next();
reversedNames[x] = lN + ", " +fN;
}
Arrays.sort(reversedNames);
for(int x=0; x<=maxIndx; x++)
System.out.println(reversedNames[x]);


}// end of main()
}//end of class


I'm not sure why I am getting this error. I saved this as AlphNames.java, but i'm still getting the error.
Back to top
View user's profile Send private message
MudGuard



Joined: 02 Mar 2003
Posts: 1254
Location: Munich, Germany

PostPosted: Thu May 10, 2012 11:27 am    Post subject: Reply with quote

Which JDK version are you using?

The class compiles without problem in JDK 1.6.0_32
Back to top
View user's profile Send private message Visit poster's website
ben_josephs



Joined: 02 Mar 2003
Posts: 2360

PostPosted: Thu May 10, 2012 12:03 pm    Post subject: Reply with quote

What is uncheked? It doesn't appear in your program.

What command are you running. It should be javac AlphNames.java (note: not javac AlphNames).
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Community Forum Index -> Java All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB