Hey,
Does anyone know how to do
the Java equivalent of the
C++ "cin >>" storing into a
variable operation?
C++
Java
Thanks,
Steve.
Does anyone know how to do
the Java equivalent of the
C++ "cin >>" storing into a
variable operation?
C++
Code:
int x = 0;
cout << "Enter a number: ";
cin >> x;
Java
Code:
int x = 0;
System.out.println("Enter a number: ");
x = System.in.readLine(); // This don't work!
Thanks,
Steve.