Menu
Question Index
...

What will be the output of the following program?

public class StringTest {
    public static void main(String[] args) {
        String String = "String";
        int temp = 2;
        Object : for (int main = 0; main < String.charAt(main); main++) {
            System.out.print(String.charAt(main) + "~");
            if (main == temp) {
                continue Object;
            }
        }
    }
}


S~t~r~
S~t~r~i~
S~t~r~i~n~g~
Some other output
Compilation Error or Runtime Error

Doubts

Problems

Topic: charAt() Method In Java - Java Character Extraction

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App