Class names error

Using the Java SDK with TextPad

Moderators: AmigoJack, helios, bbadmin, Bob Hansen, MudGuard

Post Reply
cchris
Posts: 1
Joined: Thu May 10, 2012 3:51 am

Class names error

Post by cchris »

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.
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

Which JDK version are you using?

The class compiles without problem in JDK 1.6.0_32
ben_josephs
Posts: 2456
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

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).
Post Reply