So what I'm trying to do is to get a result by reading if certain characters are contained within the arrays. First the Strings are converted to arrays of the character type so that each letter becomes a value and not just the whole word becoming one value. then the if statement should check if the arrays contain the specified letters and give the result.
public class string {
public static void main(String[] args){
System.out.println (" hello world");
String name = "y";
String surname = "o";
long id = 45;
char[] cname = new char[name.length()];
char[] csurname = new char[surname.length()];
if (cname.contains("q") && csurname.contains("d")) {
System.out.println("aa" + id + "zz");
}else{
System.out.println("gg" + id + "gg");
}
}
}