I'm just starting with Java and the following is not quite clear to me.
I wrote this piece of very basic code and it only let's me input numbers with a decimal comma, not with a decimal point.
I thought all computer input had to be with a decimal point? Or is this because of locale settings on my pc?
(only tested in Eclips SDK)
Code:
import java.util.Scanner;
public class ingave {
private static Scanner myScannerThree;
/**
* @param args
*/
public static void main(String[] args) {
myScannerThree = new Scanner(System.in);
double amount;
double getal;
System.out.print("Give me a number: ");
getal = myScannerThree.nextDouble();
amount = getal + 2.95;
System.out.print("You entered ");
System.out.print(getal);
System.out.print(". The total amount is now: ");
System.out.println(amount);
}
}