Leave a Reply 5

Your email address will not be published. Required fields are marked *


Kevin

Kevin

B is correct, tested it

obrain

obrain

B.
false, true

renko

renko

B:

Code:
public class Equal {

public static void main(String[] args) {
String str1 = “Java”;
String[] str2 = {“J”, “a”, “v”, “a”};
String str3 = “”;
for (String str : str2) {
str3 = str3+str;
}
boolean b1 = (str1 == str3);
boolean b2 = (str1.equals(str3));
System.out.println(b1+”, “+b2);
}

}
Output:
false, true