Basically it's a program to take 6 input numbers from user, store them in an Array, calculate their Mode.
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 < 6; ++i) {
int g = S.nextInt();
arr1[i] = g;
}
int input=6;
for(int i=0;i<input;i++)
int count=0;
for(int j=0;j<input;j++)
{
int temp=arr1[j];
int tempco=0;
for(int p=0;p<input;p++)
if(arr1[p].equals[temp])
tempco++;
if(tempco>count)
{
int t=temp;
count=tempco;
}}
System.out.println("the most frequent number"+t+, +count);
}}