public class arrFind{
public static void main(String[] args)
{
int [] Arr={10,12,24,-30,10};
int beginIndex=arrFind.Index(Arr,12);
System.out.println(beginIndex);
int lastindex=arrFind.lastIndex(Arr, 10);
System.out.println(lastindex);
}
public static int Index(int[] Arr,int key)
{
for(int i=0;i<Arr.length;i++)
{
if(Arr[i]==key)
public static void main(String[] args)
{
int [] Arr={10,12,24,-30,10};
int beginIndex=arrFind.Index(Arr,12);
System.out.println(beginIndex);
int lastindex=arrFind.lastIndex(Arr, 10);
System.out.println(lastindex);
}
public static int Index(int[] Arr,int key)
{
for(int i=0;i<Arr.length;i++)
{
if(Arr[i]==key)