Leave a Reply 3

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


Sucuk

Sucuk

C = correct. String is immutable so trim will not do anything. Also, the string is not empty, Java will reserve space in the heap.

renko

renko

Answer: C
package q070;

public class Test {

public static void main(String[] args) {
String str = ” “;
str.trim();
System.out.println(str.equals(“”) +” “+ str.isEmpty());
}
}
/*Output
false false
*/