Menu
Question Index
...

What will be the output of the following program?

public class Author {
    public static void main(String[] args) {
        String name = "Herbert Schildt";
        StringBuffer copy = new StringBuffer(name);
        System.out.println(name);
        System.out.println(copy);
    }
}


Herbert Schildt
Herbert Schildt
Herbert Schildt
(EMPTY)
Compilation Error
Runtime Error

Doubts

Problems

Topic: Java StringBuffer

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App