πŸ“’ Too many exams? Don’t know which one suits you best? Book Your Free Expert πŸ‘‰ call Now!

  • google app store apple app store
  • βœ–

      Question

      Output of below code public class Prg {

      public static void main(String args[]){ System.out.print("A" + "B" + 'A'); } }
      A AB65 Correct Answer Incorrect Answer
      B A6665 Correct Answer Incorrect Answer
      C ABA Correct Answer Incorrect Answer
      D Exception Correct Answer Incorrect Answer

      Solution

      Here A and B are treated as string and hence the character will be also converted to string data type in order to append it. So the answer is ABA.

      Practice Next

      Relevant for Exams:

      ask-question