• Post Reply Bookmark Topic Watch Topic
  • New Topic

HELP! Why not Compiling ? Easy but.......  RSS feed

 
Md Anisuzzaman Khan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
import java.io.*;
class NumberTester{
public static void main(String args[]) throws IOException
{
BufferedReader stdin = new BufferedReader ( new InputStreamReader(System.in ) );
String inData ;
int num ;
System.out.println("Enter an integer:");
inData = stdin.readLine() ;
num = Integer.parseInt (inData) ;
if ( num < 0 )
System.out.println("The number " + num + " is negative");
else
System.out.println("The number " + num + " is positive");
System.out.println("Good-bye for now");
}
}
Giving the error:
symbol : method parseInt (java.lang.String)
location: class Integer
num = Integer.parseInt (inData) ;
1 error
 
Marilyn de Queiroz
Sheriff
Posts: 9082
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It compiled and ran just fine for me.
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question: if it's so easy and you know it why do you need help with it?
 
Md Anisuzzaman Khan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It compiles through j2sdk1.4.0 but not for j2sdk1.4.2 Surprisingly!!!
Thanks
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
compiles under 1.4.2_02 under Linux.
compiles under 1.4.2.b28 under Windows as well.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!