Menu
Question Index
...

What will be the output of the following program?

public class TheBest
{
    public void sameClass(Integer i)
    {
        System.out.println("Integer sameClass");
    }
    
    public void sameClass(int i)
    {
        System.out.println("int sameClass");
    }
    
    public static void main(String args[])
    {
        new TheBest().sameClass(8);
    }
}


Integer sameClass
int sameClass
int sameClass
Integer sameClass
Integer sameClass
int sameClass
Compilation Error

Doubts

Problems

Topic: Creating Objects for Primitive Data Types (Byte, Short)

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App