0
public class Main {
    public static Object [] objArr = new Object[1];

    public static void main (String [] args) {
        objArr[0] = 4.20; // double value
        System.out.println("MEMES "  + Arrays.toString(objArr));
    }
}

The output displays "MEMES 4.20" correctly. My question is, how does the Object class contain primitive values? I thought primitive values are not subclasses of Java Object classes.

besnuj
  • 21
  • 3
  • 1
    [Autoboxing](https://docs.oracle.com/javase/tutorial/java/data/autoboxing.html). – Elliott Frisch May 09 '17 at 00:04
  • 1
    It doesn't. It will contains objects, specifically a `Double` in this case. That's called [autoboxing](https://docs.oracle.com/javase/tutorial/java/data/autoboxing.html). – Jack May 09 '17 at 00:05

0 Answers0