Creating and Storing Objects (Instantiation)

AP Computer Science A· difficulty 3/5

The keyword <code>new</code> is used to

  • A

    Allocate a new object and call its constructor

    check_circle
  • B

    Declare a variable

  • C

    Compare references

  • D

    Cast a type

Explanation

<code>new ClassName(...)</code> allocates memory and runs constructor.

Want 10 more like this — adaptive to your weak spots?

Related questions