Multiple choice technology programming languages

Which of the following will throw an error while compilation 1) import java.awt.; package Mypackage; class Myclass {} 2) package MyPackage; import java.awt.; class MyClass{} 3) /This is a comment */ package MyPackage; import java.awt.; class MyClass{}

  1. Option 1

  2. Option 2

  3. Option 1 & 2

  4. Option 3

  5. Option 2 & 3

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

Java requires that package statements must come before import statements, and both must appear before any class definitions. Option 1 violates this rule by placing import before package. Options 2 and 3 follow the correct order: package, then import, then class.