Let's assume
String a = "123";
String c = "123";
String b = new String(a);
Which of the following expression is True
c == b |
||
a.compareTo(c)>0 |
||
c.equals(b) |
||
a == b |
||
b.equals(a) |
public class Main {
public static void main(String[] args) {
String a = "123";
String c = "123";
String b = new String(a);
if (c.equals(b))
{
System.out.println("hii");
}
else
{
System.out.println("hello");
}
}
}
Hope this code will help you
Thank You!!
Get Answers For Free
Most questions answered within 1 hours.