Recently, I've been trying to figure out how to make this work as a .jar w/o graphics. It's basically an addition practice program xD I'm not sure if this will help, but here's the code:
import java.util.*; import java.util.Random; public class booleantest { public static void main(String[] args){ int d = 0; while (d == 0){ Random rand = new Random(); int randomnumber = rand.nextInt(1000); boolean fail = true; Scanner sum= new Scanner(System.in); System.out.println("Please enter the sum of these two numbers:"); int b = randomnumber; Random rand1 = new Random(); int randomnumber1 = rand1.nextInt(1000); int c = randomnumber1; System.out.println(b + " and " + c); int a = sum.nextInt(); if (a==(b+c)){ System.out.println(fail); } else { System.out.println(!fail); } } } }
It just says that "A java exception has occurred." when I try to execute the exported .jar file.
Thank you in advance!
Offline
Bumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbump
Offline