Bird
0
0

In Ruby's exception hierarchy, which class is the direct parent of StandardError?

easy📝 Conceptual Q1 of 15
Ruby - Error Handling
In Ruby's exception hierarchy, which class is the direct parent of StandardError?
AObject
BException
CRuntimeError
DScriptError
Step-by-Step Solution
Solution:
  1. Step 1: Understand Ruby's exception hierarchy

    The root class for exceptions is Exception. Most common errors inherit from it.
  2. Step 2: Identify the parent of StandardError

    StandardError is a subclass of Exception, making Exception its direct parent.
  3. Final Answer:

    Exception -> Option B
  4. Quick Check:

    Parent of StandardError = Exception [OK]
Quick Trick: StandardError inherits directly from Exception in Ruby [OK]
Common Mistakes:
  • Confusing RuntimeError as parent
  • Thinking Object is parent
  • Mixing ScriptError with StandardError

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Ruby Quizzes