Menu
Topics Index
...
`

getChars2885


If you need explanation Read this topic

If you need Answer Take test on this topic

getChars2885
What will be output of the following program?
public class StringBufferDemo {
    public static void main(String[] args) {
        StringBuffer buff = new StringBuffer("Oh! Java Programming");
        System.out.println("Buffer = " + buff);
        char[] array = new char[]{'M', 'e', 'r', 'i', 't', ' ', 'C', 'a', 'm', 'p', 'u', 's'};
        buff.getChars(2, array.length + 1, array, 1);
        System.out.println(array);
    }
}

A. Buffer = Oh! Java Programming
Merit Campus
B. Buffer = Oh! Java Programming
! Java Programming
C. Buffer = Oh! Java Programming
M! Java Prog
D. Compilation Error or Runtime Error
Topic: StringBuffer getChars() Method In Java With Example

If you need explanation Read this topic

If you need Answer Take test on this topic

User comments below. All of them might not be correct.

This dose is now closed and the winners are Sai Ram,  for 'First Correct Comment', Sai Ram,  for 'Best Comment' and Sai Ram for the 'Popular Comment'. The 'lucky liker' is Sai Ram. Please login into Merit Campus using facebook, to claim your recharge. Go to http://java.meritcampus.com/earnings to raise the recharge.

Posted by Merit Campus    2015-02-20 05:10:55


© meritcampus 2019

All Rights Reserved.

Open In App