Multiple choice technology

Which of the following classes are available in the java.lang package? (A) Stack (B) Object (C) Math (D) Random (E) String (F) StringBuffer (G) Vector

  1. (B), (C) & (E)

  2. (B), (C), (E) & (F)

  3. B), (E) & (F)

  4. (A), (B), (C), (E) & (F)

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

The java.lang package contains fundamental classes that are automatically imported. Object, Math, and String are in java.lang, as is StringBuffer. Stack, Vector, and Random are in other packages (java.util). Option B correctly identifies all four classes that belong to java.lang: (B) Object, (C) Math, (E) String, and (F) StringBuffer.