title: How can i get the single mode value?
body: <p>Basically it's a program to take 6 input numbers from user, store them in an Array, calculate their Mode.</p>
  
  <pre><code>package p18;
  import java.util.Scanner;
  public class P18 {
   public static void main(String[] args) { 
      Scanner S=new Scanner(System.in);
      int[] arr1=new int [6];
      for (int i = 0; i &lt; 6; ++i) {
      int g = S.nextInt();
      arr1[i] = g;
   }
   int input=6;
   for(int i=0;i&lt;input;i++)
     int count=0;
   for(int j=0;j&lt;input;j++)
   {
     int temp=arr1[j];    
     int tempco=0;
     for(int p=0;p&lt;input;p++)   
      if(arr1[p].equals[temp])
     tempco++;
     if(tempco&gt;count)
     {
       int t=temp;
       count=tempco; 
     }}
   System.out.println("the most frequent number"+t+, +count); 
  }}
  </code></pre>