How to Set user Input to Int's and Doubles (Java)
Go to solution
Solved by Guest,
Is it possible to do this:
import java.util.Scanner;public class DamageCalc{
public static void main(String[] args){
Scanner s = new Scanner(System.in);
System.out.println("Please pokemon statistics");
int Type = s.nextInt();
int ATTACK = s.nextInt();
int Defense = s.nextInt();
int Base = s.nextInt();
int STAB = s.nextInt();
int Critical = s.nextInt();
double Random = s.nextDouble();
s.close();
}
}
Yes but your program will throw an exception and fail if one of those elements is missing or incorrectly entered.

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now