Q.– Given:
class Equal {
public static void main(String[] args) {
String strl = "Java";
String str2 = {"J", "a", "v", "a"};
String str3 = " ";
for (String str : str2) {
str3= str3+str;
}
boolean b1 = (str1.equals(str3));
boolean b2 = (strl = = str3);
System.out.print (b1+", "+b2);
}
}
What is the result?
A) false, true
B) true, false
C) true, true
D) false, false
⧪ please give your answer in a comment section.
class Equal {
public static void main(String[] args) {
String strl = "Java";
String str2 = {"J", "a", "v", "a"};
String str3 = " ";
for (String str : str2) {
str3= str3+str;
}
boolean b1 = (str1.equals(str3));
boolean b2 = (strl = = str3);
System.out.print (b1+", "+b2);
}
}
What is the result?
A) false, true
B) true, false
C) true, true
D) false, false
⧪ please give your answer in a comment section.
4 Comments
Option A
ReplyDeleteA
ReplyDeleteB
ReplyDeleteD
ReplyDelete