Static Variables and Methods

AP Computer Science A· difficulty 4/5

A <code>static</code> method

  • A

    Cannot access instance variables (no <code>this</code>)

    check_circle
  • B

    Returns null

  • C

    Can access instance variables directly

  • D

    Must use <code>this</code>

Explanation

Static methods don't have a receiver; access static fields or take object as parameter.

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

Related questions