Menu
Question Index
...

Write a program to find the character at the given index of the StringBuffer object.

Input (StringBuffer, Integer) Output (Character)
'Thomas Edison', 7 'E'
'RamaRao', 4 'R'
'Kiran', 4 'n'



class CharAtStringBuffer
{
    public static void main(String s[])
    {
        StringBuffer stringBuffer = new StringBuffer("Thomas Edison");
        int index = 7;
        System.out.println("Character at the given index of the StringBuffer object is : " + getCharacterAtStringBuffer(stringBuffer, index));

    }


    public static char getCharacterAtStringBuffer(StringBuffer input, int index) {
    }

}

Doubts

Problems

Topic: Java charAt() And setCharAt() Methods in StringBuffer

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App