KnowledgeBoat Logo

Computer Applications

Give the output of the following code:

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

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

Java String Handling

ICSE 2022

6 Likes

Answer

GoodDay

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

Answered By

6 Likes


Related Questions