title: How can input from keyboard in array in java
body: <p>In my program there is some error so pls help me</p>
  
  <pre><code>package string_demo;
  
  import java.util.Scanner;
  
  public class array_find_min_max_no {
  
      static void min(int arr[]){  
  
          //arr=Integer.parseInt();
          int min=arr[0];  
          int max=arr[0];
          for(int i=1;i&lt;arr.length;i++) { 
  
              if(min&gt;arr[i])  {
                  min=arr[i];  
              }
              if(max&lt;arr[i]) {
                  max=arr[i];  
              }
          }
          System.out.println(min);
          System.out.println(max); 
      }  
  
      public static void main(String args[]){
          Scanner sc=new Scanner(System.in);
          int b[]=sc.next();
          min(b);//passing array in the method  
      } 
  }
  </code></pre>