ICSE Class 10 Computer Applications Question 6 of 10

Solved 2022 Semester 2 Question Paper ICSE Class 10 Computer Applications — Question 6

Back to all questions
6
Question

Question 1(vi)

Give the output of the following code:

System.out.println("Good".concat("Day"));

  1. GoodDay
  2. Good Day
  3. Goodday
  4. goodDay
Answer

GoodDay

Reason — concat() method is used to join two strings. Thus, "Good" and "Day" are joined together and printed as "GoodDay".