(JAVA question)
Write a method named intersection that accepts two strings as the arguments, returns the characters that occur in both strings. For example, if the arguments are “apple#123” and “banana$#345”, your program should return “a#3”.
public class StringsIntersection {
public static String intersection(String s1, String s2) {
String common = "";
for (int i = 0; i < s1.length(); i++) {
if (s2.indexOf(s1.charAt(i)) >= 0) {
common += s1.charAt(i);
}
}
return common;
}
public static void main(String[] args) {
System.out.println(intersection("apple#123", "banana$#345"));
}
}

(JAVA question) Write a method named intersection that accepts two strings as the arguments, returns the...