Multiple choice string The code snippetif( "Welcome".trim() == "Welcome".trim() )System.out.println("Equal");elseSystem.out.println("Not Equal");will A. Compile and display “Equal” B. Compile and display “Not Equal” C. Cause a compiler error D. Compile and display NULL Reveal answer Fill a bubble to check yourself A Correct answer Full explanation
Multiple choice string Consider the following code snippet. What will be assigned to the variable fourthChar, if the code is executed? String str = new String(“Java”); char fourthChar = str.charAt(4); A. ‘a’ B. ‘v’ C. throws StringIndexOutofBoundsException D. null characater Reveal answer Fill a bubble to check yourself C Correct answer Full explanation