Question
Option 1 : protected / protected
Detailed Solution
सही उत्तर protected / protected है।
Question:
A field must be accessible from subclasses even when they reside in a different package (through inheritance), but not from unrelated classes. Which modifier should be used? / एक फ़ील्ड उपवर्गों से — चाहे वे भिन्न पैकेज में हों (इनहेरिटेंस के माध्यम से) — सुलभ होनी चाहिए, पर असंबंधित वर्गों से नहीं। कौन-सा मॉडिफायर प्रयोग करना चाहिए?
Correct Answer: protected / protected
protected grants access within the same package and to subclasses in other packages via inheritance; private blocks subclass access, default is package-only, and final is not an access modifier. / protected एक ही पैकेज में और अन्य पैकेजों के उपवर्गों को इनहेरिटेंस के माध्यम से पहुँच देता है; private उपवर्ग की पहुँच रोकता है, डिफ़ॉल्ट केवल पैकेज-स्तरीय है, और final एक्सेस मॉडिफायर नहीं है।