below is my code which is throwing error:
Cannot invoke size() on the array type int[]
Code:
public class Example{
int[] array={1,99,10000,84849,111,212,314,21,442,455,244,554,22,22,211};
public void Printrange(){
for (int i=0;i<array.size();i++){
if(array[i]>100 && array[i]<500)
{
System.out.println("numbers with in range ":+array[i]);
}
}
Even i tried with array.length() it also throwing the same error. When i used the same with string_name.length() is working fine.
Why it is not working for an integer array?