title: Scanning doubles when I separate decimals with comma or dot
body: <p>I'm rather new to Java and I was making a simple calculator. Problem is when I my input number is for example "3.1" it gives an exception error, but when writing "3,1" it works just fine.</p>
  
  <p>My friend, however, has a slightly more advanced calculator (with string parsing) and when I run his code the opposite happens: 3,1 gives exception error, 3.1 works perfectly.</p>
  
  <p>I was looking forward to know what causes these different behaviors.</p>
  
  <p>I made this simple sum just now and the same happens, I'll edit and put his calculator code in a few minutes</p>
  
  <pre><code>import java.util.Scanner;
  
  public class Tutorial_7 {
      public static void main(String args[]){
          Scanner scan = new Scanner(System.in);
          double num1, num2;
  
          System.out.println("Introduza os dois números");
  
          System.out.println("1º: ");
          num1 = scan.nextDouble();
          System.out.println("2º: ");
          num2 = scan.nextDouble();
  
          System.out.println((num1 + num2));
          scan.close();
      }
  
  }
  </code></pre>
  
  <p>Final edit: He does use <code>Double.parseDouble()</code>. Got it, the difference is indeed in where it is localized. Should have looked for it but never heard of this concept before. </p>
  
  <p>Thank you </p>