I am trying to make very simple number baseball program which compare 3 numbers in array and calculate the result in strike ball and out. for example if randomly generated numbers are 154 and each number is stored in answer[] using rand.nextInt(10) and and My input is c:\>134 in command line not as perameters I used System.in.read() method to store number from command line my problem is... with randomly generated int array and console inputted array I can't compare...I don't know why... can anybody tell me what's wrong and how can I solve this problem??