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

3 Likes

Answer

GoodDay

Reason — concat() method will add "Day" at the end of "Good" and "GoodDay" will be printed on the screen.

Answered By

2 Likes


Related Questions