Monday, August 15, 2011

I need help with this Java Program I can't get it working correctly?

THe problem is here: "score = new Scanner.nextInt();" you are using int type to enter data into String score. That is not permitted. Scanner cannot accomodate Strings. The best one to use is BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); Its working is same as DataInputStream plus it is highly efficient. Use score=br.readLine(); for string input.

No comments:

Post a Comment