Hi i m having problem...
i want to give each random number to each month..
but it gives erros
public class a
{
public static void main(String[] args)
{
float average = 0f;
String[] Year = {"Jan","Feb","Mar","Apr","May","Apr"};
int[] values = new int[5];
for(int i=0; i<values.length; i++)
{
values[i] = (int)(100*Math.random());
average+=values[i];
}
average=average/values.length;
for(int j=0; j<Year.length; j++)
{
Year[j] = (values[j]);
}
System.out.println(average);
}
}
Error is
C:\Users\dell\Desktop\a.java:20: incompatible types
found : int
required: java.lang.String
Year[j] = (values[j]);
^
1 error
Tool completed with exit code 1