Menu
Question Index
...

What will be the output of following program?

public class Concat {
    public static void main(String args[]) {
        char[] c = {'k', 'e', 'y', 'b', 'o', 'a', 'r', 'd'};
        String s = "computer ";
        String s1 = new String(c);
        String s2 = s.concat(s1);
        System.out.print(s2);
    }
}


computer keyboard
computerkeyboard
computer
keyboard
Compilation Error or Runtime Error

Doubts

Problems

Topic: concat() method In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App