Menu
Question Index
...

What will be the output of the following program?

public class Comedian {
    public static void main(String args[]) {
        String ali[] = {"12", "13", "14"};
        int i = Integer.parseInt(ali[0]);
        i = Integer.parseInt(ali[1]);
        i = Integer.parseInt(ali[2]);
        System.out.println(i + i + i);
        System.out.print(i + " " + i + " " + i);
    }
}


39
12 13 14
42
14 14 14
Some other output
Compilation Error or Runtime Error

Doubts

Problems

Topic: Converting Numbers to and from Strings 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