aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • Java Practice Test - 3
  • The code snippet if( "Welcome".trim() == "Welcome".trim()...
Multiple choice

The code snippet if( "Welcome".trim() == "Welcome".trim() ) System.out.println("Equal"); else System.out.println("Not Equal"); will

  1. compile and display “Equal”

  2. compile and display “Not Equal”

  3. cause a compiler error

  4. compile and display NULL

Reveal answer Fill a bubble to check yourself
C Correct answer

Keep practicing — related questions

  • 20 Read this piece of code carefully if(" String ".trim() == "String") System.out.println("Equal"); else Sy...
  • What is the output of the following piece of code? if(" String ".trim() == "String") System.out.println("We...
  • 19 Read this piece of code carefully if("String".toString() == "String") System.out.println("Equal"); else ...
  • Read this piece of code carefully if("String".toString() == "String") System.out.println("Equal"); else Sys...
  • If you compile and execute an application with the following code in its main() method: String s = new Stri...
  • if("String".toString() == "String") System.out.println("Equal"); else System.out.println("Not Equal");
  • if("String".toString() == "String") System.out.println("Equal");else System.out.println("Not Equal");
  • if("String".replace('t','T') == "String".replace('t','T')) System.out.println("Equal"); else System.out.pri...
Play the full quiz 🎤 Practise this topic out loud
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy