Menu
Question Index
...

What will be the output of the following program?

public class Directors {
    public static void main(String args[]) {
        Float[] puri = {15.0f, 20.0f, 30.0f};
        String str = "";
        for (Float element : puri) {
            str += element;
        }
        System.out.print(str.toString());
    }
}


65
65f
15.0f20.0f30.0f
152030
15.020.030.0

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