Menu
Question Index
...

What will be the output of the following program?

public class Extension {
    static void helloLong(long... x) {
        System.out.println("This is Long");
    }
    static void helloInteger(Integer... x) {
        System.out.println("This is Integer");
    }
    static void helloString(String... str) {
        System.out.println("This is " + str[0]);
    }
    public static void main(String[] args) {
        int mC = 5;
        helloLong(mC, mC);
        helloInteger(mC, mC);
        helloString("String");
    }
}


This is Long
This is Integer
This is String
This is Long
This is Integer
This is
This is String
Some other output
Compilation Error or Runtime Error

Doubts

Problems

Topic: Java Multiple Methods In One Class

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App