Aliensbrain
  • Home
  • Topics
  • Quizzes
  • Notebooks
  • Community
  • Sign in
  • science & technology Online Quiz - 342
  • What is the output of following? public class Test { pu...

What is the output of following? public class Test { public static void main(String[] args) { new Test(); } public Test() { PrintChar printA = new PrintChar('a', 4); PrintChar printB = new PrintChar('b', 4); printA.run(); printB.run(); } class PrintChar implements Runnable { private char charToPrint; private int times; public PrintChar(char c, int t) { charToPrint = c; times = t; } public void run() { for (int i = 0; i < times; i++) System.out.print(charToPrint); } } }

general knowledge science & technology
  1. run-time error

  2. aabbaabb

  3. bbbbaaaa

  4. abababab

  5. aaaabbbb


Show answer
Correct Option: E

Find more quizzes:

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