Multiple choice technology programming languages

What is the advantage of using import statements?

  1. To avoid having to declare variables

  2. To refer to a class without using prefixes

  3. To avoid calling methods

  4. To import the images you want to use

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

Import statements allow you to reference classes by their simple names instead of using fully qualified names with package prefixes. This improves code readability and reduces verbosity - instead of writing 'java.util.ArrayList' repeatedly, you can import it once and use 'ArrayList' throughout your code.