0

I need to write a Junit test, Since it do not have return type and arguments, I am getting difficulty to write it. Could anyone help in this ?

public class IndexElement{
   public static void main(String[] args){
        int arr[] ={12,34,30,40};
        int lastele = 40;
        int index = 0;
        for(int i =0 ; i< arr.length; i++)
        { if(arr[i] == lastele)
          { 
            index = i;
            break;
          }
        }
 System.out.println("Index of element" +index);
}
}
Ramu
  • 1
  • 1

0 Answers0