Menu
Question Index
...

What will be the output of the following program?

public class Flipkart {
    public static void main(String[] args) {
        String name, offers = "", type;
        name = "ONE " + "STOP " + "SHOP";
        offers += 50;
        type = "ELECTRONICS";
        offers += '%';
        System.out.println(name + " FOR ALL OUR BEST " + offers + " OFFERS ON " + type);
    }
}


ONE STOP SHOP FOR ALL OUR BEST OFFERS ON ELECTRONICS
ONE STOP SHOP FOR ALL OUR BEST 50% OFFERS ON ELECTRONICS
Compilation Error
Runtime Error

Doubts

Problems

Topic: Java String Concatenation with Other Data Types

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App