How to get Array from user
<p>This program is working but I want take A[] array input from the user. Please somebody tell me how to take input from the user and use that input as an array in the program.</p>

<pre><code> public class rough1{
 public static int arrMajority1(int A[]){
 int n = A.length;

 for(int i=0;i&lt;A.length;i++){
 int c = 1;
 for(int j=i+1;j&lt;A.length;j++)
 if (A[i]==A[j])
  c=c+1;
  if (c&gt;(A.length/2)){
  return A[i];
  }
  }

   return -1;
  }

   public static void main(String[] args){
    int A[] = new int [] {1,1,7,5};
   // int arrMajority1 = A[0];
     if (arrMajority1(A) != -1)

    System.out.println("The majority element is " + arrMajority1(A));

    else 
    System.out.println("There is no majority element.");
    }
}
</code></pre>
