Menu
Question Index
...

What will be the output of the following program?

public class Exam {
    public static void main(String args[]) {
        Float pen = 20.20f;
        String paper= Float.toString(pen);
        System.out.println(paper);
        paper = pen.toString();
        System.out.print(paper);
    }
}


20.2
20.2
20.2f
20.2
20.2
20.2f
Compilation Error or Runtime Error

Doubts

Problems

Topic: Java Double Class And Java Float Class

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App