Menu
Question Index
...

What will be the output of the following program?

public class RemoveChar
{
    public static void main(String args[])
    {
        String str = "Good Day.\n This is java program.";
        System.out.println(removeCharAt(str, 9));
    }
    public static String removeCharAt(String s, int pos)
    {
        return s.substring(0, pos) + s.substring(pos + 1);
    }
}


Good Day.
This is java program.
Good Day. This is java program.
Good Day.
This is java program.
Compilation Error
Runtime Error

Doubts

Problems

Topic: Java String substring() method - substring 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