Aliensbrain
  • Home
  • Topics
  • Quizzes
  • Notebooks
  • Community
  • Sign in
  • programming languages Online Quiz - 43
  • What is the output for the below code ? public class B { ...

What is the output for the below code ? public class B { public String getCountryName(){ return "USA"; } public StringBuffer getCountryName(){ StringBuffer sb = new StringBuffer(); sb.append("UK"); return sb; } public static void main(String[] args){ B b = new B(); System.out.println(b.getCountryName().toString()); } }

technology programming languages
  1. Compile with error

  2. USA

  3. UK

  4. Runtime Exception


Show answer
Correct Option: A

Find more quizzes:

© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy