I have about two weeks of experience with
JAVA and my question is thus. I wrote some code with help from the text and in each instance I pop it into JGrasp and it compiles ok. I try to run the code and it just keeps running and running and running.
Here it is. Is there something I am missing? Should i try another like Netbeans and see if I get a solution?
import java.util.*;
public class SecondJavaProgram
{
static Scanner console = new Scanner(System.in);
public static void main(
String[] args)
{
int num1;
int num2;
num1 = 4;
num2 = console.nextInt(2);
System.out.println(num1+""+num2);
}
}
OR
import java.util.*;
public class SecondJavaProgram
{
static Scanner console = new Scanner(System.in);
public static void main(String[] args)
{
int num1;
int num2;
num1 = 4;
num2 = console.nextInt(0);
System.out.println(num1+""+num2);
// this has the zero in console.nextInt
//this gave me a string of results and also a "00"