title: How to input period as decimal point?
body: <p>I need to make a program that find the minimum difference of an array of float by sorting it first. The problem is the Scanner wont take period (.) as a decimal point (for example if i input 2.251 it will read it as 2251.0).
  Here is a part of the code</p>
  
  <pre class="lang-java prettyprint-override"><code>import java.util.Scanner;
  public class Selisih {
      public static void main(String[] args){
          Scanner sc = new Scanner(System.in);
          int m = sc.nextInt();
          float[] arr = new float[m];
          for(int i = 0; i &lt; m; i++){
              arr[i] = sc.nextFloat();
          }
          quickSort(arr, 0, m - 1);
          System.out.printf("%.3f", minDiff(arr));
      }
  </code></pre>