rami3
Nov 11th, 2002, 06:29 AM
I've just started learning java, the college where im learning it has provided me with an class that handles input from the keyboard, problem is that the college is using sun's java 1.2, im using 1.4 at home, when I try and run a program calling any methods i always get 0 returned.
eg if i try and run (at home)
class Test {
public static void main (String [] args) {
System.out.println("Enter a number");
int number = UbiIO.readInt();
System.out.println(+number);
}
}
I get back
Error: Not an integer
I dont even get the chance to input the number.
At work where we use v1.2 (on linux) it lets me input the number but wont continue until i press space then enter, then i get the same error message back as above.
I asked my tutor and got the reply "yes im aware of that problem", when i asked for a way to fix the class i got the reply "havent got the time, you should try and work it out yourself etc etc"
OK fair enough, excpt i dont bloody know enough yet to do that, we dont even start IO streams until january, until then we have to use this class they provided.
We are allowed to modify, do what we like with the class, so i have attached it to this message, if somebody could explain what is wrong with it or point me in the right direction as to how i could fix it i would be very appreciative.
RB :)
eg if i try and run (at home)
class Test {
public static void main (String [] args) {
System.out.println("Enter a number");
int number = UbiIO.readInt();
System.out.println(+number);
}
}
I get back
Error: Not an integer
I dont even get the chance to input the number.
At work where we use v1.2 (on linux) it lets me input the number but wont continue until i press space then enter, then i get the same error message back as above.
I asked my tutor and got the reply "yes im aware of that problem", when i asked for a way to fix the class i got the reply "havent got the time, you should try and work it out yourself etc etc"
OK fair enough, excpt i dont bloody know enough yet to do that, we dont even start IO streams until january, until then we have to use this class they provided.
We are allowed to modify, do what we like with the class, so i have attached it to this message, if somebody could explain what is wrong with it or point me in the right direction as to how i could fix it i would be very appreciative.
RB :)