Home Tutorial Java Scjp Part7 SCJP Module-7 Question-6

 
 

Share on Google+Share on Google+
SCJP Module-7 Question-6
Posted on: July 13, 2010 at 12:00 AM
Advertisement
The program given below will test your understanding about the Integer and int data types in Java programming language and helps you for preparation of SCJP exam.

Given a sample code:

1    public class Test {
2    public static void main(String[] args) {
3    int i = 1;
4    method(i);
5    }
6    static void method(int i){
7    System.out.println("Primitive");
8    }
9    static void method(Integer i){
10  System.out.println("Wrapper");
}}

What will be the result of above code ?

(1) Primitive
(2) Wrapper
(3) Compile time error at line no 6.
(4) Compile time error at line no 9.

Answer:

(1)

Advertisement

Related Tags for SCJP Module-7 Question-6:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: July 13, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com