Question

When designing a class, why is it generally a bad practice to make all fields public?

A It makes the class abstract.
B It violates the principle of encapsulation, leading to potential data corruption and reduced maintainability.
C It prevents the class from being inherited.
D It makes the class static.
E It causes compilation errors.
Practice Next

Hey! Ask a query

🎓
Think You're Ready for RBI Grade B?
RBI Grade B 2026 Phase 1 Memory Based Paper
  • 200 Questions with Detailed Solutions
  • Section-wise Coverage (GA, English, Quant & Reasoning)