Very simple Java question
July 28th, 2013
This is the code:
import java.util.Scanner;
public class Apples {
public static void main(String[] args) {
Scanner Black = new Scanner(System.in);
int Berry = (Black.nextInt());
if (Black.nextInt() ){
System.out.println("Black is an integer");
}else if (Black.nextLine()){
System.out.println("Black is not an integer");
}
}
}
I don’t know why it doesn’t work
(BTW: I’ve never ever programmed anything and this is one of my first things I want to try..)
Thnx in advance
You should look into Exceptions in Java. This is a hint for you, don’t want to spoon feed
thnx found it