I'm pretty new to programming feel free to be harsh in your replies. Anything helps. Basically I'm trying to call in a method LineCount() but when I try to compile the command prompt complains about .class being expected at String[A] (line 8 I believe)
*Thank you guys for all your help! My code works now! I really appreciate all the input
import java.util.Scanner;
import java.io.*;
public class FileCount{
public static void main(String[] args) throws IOException{
String[] in = new Scanner(new File(args[0]));
System.out.println(lineCount(String[] in);
}
public static void lineCount(String[] A){
// check number of command line arguments
if(args.length != 1){
System.err.println("Usage: LineCount file");
System.exit(1);
}
// count lines, words, and chars in file
int lineCount = 0;
while( in.hasNextLine() ){
in.nextLine();
lineCount++;
}
in.close();
System.out.println( args[0]+" contains "+lineCount+" lines" );
}
}