Menu
Question Index
...

What will be the output of the following program?

public class StringDemo {
    public static void main(String[] args) {
        String m = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
        System.out.println(m.length());
        m += "abcdefghijklmnopqrstuvwxyz";
        System.out.println(m.length());
        m = "0123456789";
        System.out.println(m.length());
    }
}


26
52
62
26
26
10
26
52
10
Compilation Error or Runtime Error

Doubts

Problems

Topic: Java length() Method | length() Method In Java - Strings

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App