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


Share on Google+Share on Google+
SCJP Module-7 Question-2
Posted on: July 13, 2010 at 12:00 AM
The program given below will test your understating about the Integer class and int data types in Java.

Given a sample code:

1    public class Test {
2    public static void main(String[] args) {
3    Integer in = 1;
4    int i = 1;
5    System.out.print(in.equals(i));
6    System.out.print(in == i);

What will be the result of above code ?

(1) false false
(2) true true
(3) false true
(4) true false 




Related Tags for SCJP Module-7 Question-2:

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