Multiple choice

To create swing components, which of the following is imported?

  1. javax.awt.*

  2. java.awt.*

  3. javax.swing.*

  4. java.swing.*

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Swing components are in the javax.swing package, which must be imported to use them. The java.awt package contains the original AWT (Abstract Window Toolkit) components, while java.swing and javax.awt are incorrect package names that don't exist in the standard Java library.