2 Replies Latest reply on Jan 3, 2008 12:22 PM by 807603

    Object references and array of integers


      Taking some java test, I came across the following question:

      Given the below (UML) diagram, how many of the ClassA attributes will be object references when this class is implemented in the Java language?:
             ClassA                                         <<enumeration>>    
                                    ------------------->         Enum1
            var1 : int                                               
            var2 : String                                         Elem1
            var3 : int[]                                          Elem2
            var4 : float                                          Elem3
            var5 : Double                                         Elem4
            var6 : Enum1   
      I answered 3, but the correct answer was 4. The one which I did not include was var3. Why will var3 be an object reference?

      Thank you,