I'd like this code to be improved.
import java.util.Scanner;
public class ArrayElementFind {
public static void main(String[] args) {
// TODO Auto-generated method stub
String[] arr= { "A","B","C","D"};
Scanner in=new Scanner(System.in);
System.out.println("Enter the char to search");
String a=in.nextLine();
//int len=arr.length;
boolean check=loopcheck(arr,a);
if(check){
System.out.println("Element is present");
}
else{
System.out.println("Element is not present");
}
}
private static boolean loopcheck(String[] arr, String a) {
// TODO Auto-generated method stub
for(String s:arr){
if(s.equals(a)){
return true;
}
}
return false;
}
}