This is some information on the Java 6 certification that I prepare. This information is not very well structured and it is most of the time an answer to the questions that come when I read the SCJP 6 book (Bates and Sierra). *** AS OF 5 OF MARCH 2010, I AM SCJP 6.0 ***

Friday, January 29, 2010

27 - Review - type of an array - level basic - Java 1.6.0_17 - NB 6.8

What is the output ?

package pkg1;

public class Class10 {

    static Integer[] arrayofINT = { 1, 2, 3, 4 ,5};

    public static void main(String[] args) {

        if(arrayofINT instanceof Object) {
            System.out.println("arrayofINT is an Object !");
        }
        if(arrayofINT instanceof Integer[]) {
            System.out.println("arrayofINT is an Integer[] !");
        }
    }
}

run:
arrayofINT is an Object !
arrayofINT is an Integer[] !
BUILD SUCCESSFUL (total time: 0 seconds)

No comments:

Post a Comment

Followers