P

Pradeep Sikarwar • 9.01K Points
Tutor III

Q. What will be the output of the following code

Code:
class PrintValue
{
<t> void display(t obj[])
{
for(t i:obj)
{
System.out.println(i+” “);
}
}
}
public class MyClass {
public static void main(String…args)
{
Abc obj1=new Abc();

Integer i[]= {1,2};
obj1.display(i);

Double d[]= {1.1,2.2};
obj1.display(d);
}
}
  • (A) 1 2 1.1 2.2
  • (B) Runtime exception
  • (C) Compile time exception
  • (D) None
  • Correct Answer - Option(A)
  • Views: 119
  • Filed under category JAVA

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.


Question analytics