0

Whats the problem with my code? Below there isnt enogh space. I continoue here. System.out.println... After this else comes

Can somebody tell me what is the problem? import java.util.Scanner; public class Program { public static void main(String[] args) { int age, money; System.out.println("Write your age: "); Scanner ageScan = new Scanner(System.in); System.out.println("Write your money: "); Scanner moneyScan = new Scanner(System.in); age = ageScan.nextInt(); money = moneyScan.nextInt(); if (age <18 && money <500){

1st Nov 2016, 6:47 PM
Adam
Adam - avatar
5 Answers
0
What error are you getting exactly?
1st Nov 2016, 6:56 PM
nedas
nedas - avatar
0
exception in thread "main" and it writes problems with java.utils.Scanner (unknown sources)
1st Nov 2016, 7:06 PM
Adam
Adam - avatar
0
maybe the position of the vars,put each one after print
1st Nov 2016, 7:46 PM
Wanderlei Borges
Wanderlei Borges - avatar
0
it isnt better in that way. :(
1st Nov 2016, 7:52 PM
Adam
Adam - avatar
0
at first i have to use '||' not '&&' and on my computer this program works so i dont know what is the problem here
1st Nov 2016, 8:25 PM
Adam
Adam - avatar