Menu
Question Index
...

What will be the output of the following program?

public class BankAccountInf {
    public static void main(String[] args) {
        int accountNumber = 401;
        double bankBal = 1029.939;
        String name = "Goutham";
        String print = name.concat("'s account number is ").concat(String.valueOf(accountNumber));
        print = ("-bank bal is ").concat(String.valueOf(bankBal));
        System.out.println(print);
    }
}


Goutham's account number is 401-bank bal is 1029.939
-bank bal is 1029.939
Compilation Error
Runtime Error

Doubts

Problems

Topic: Data Conversion Using valueOf 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