I want to compare between char array and char

Code:
//compare 2  char  with for loop
import java.util.Arrays;
class TestCheck{
	public static void main (String args[]){
		String str = "AB";
		int len,len2;
		char[] charArray = str.toCharArray();
		char inputChar;
		inputChar = 'A';
		System.out.print("\n");
		System.out.print("String is  "+str);
		System.out.print("\n");
		System.out.print("\n");
		
		for(int i = 0;i<charArray.length;i++){
			System.out.println("char array is>>"+charArray[i]);
		}
		len = charArray.length;
		System.out.println("length of char array is>>"+len);
		System.out.print("\n");
		
		System.out.println("input char is>>  "+inputChar);
	
		///////////////////////////////////////////////////////
		//compare two arrayList
		
			for(int index = 0;index<charArray.length;index++){
					if(charArray[index] == inputChar){
						System.out.println("index  "+index+"  equals");
					}else{
						System.out.println("index  "+index+"  not equals");
					}
			}
	
		
	
	
	}
}
This code no error,but I want to declare method Check() for compare charArray and inputChar
I 'm niebie in java.I want some advice for declare method Check.
Thanks.