Question
1. Predict the output of the code public
class Animal { public static void main(String args[]) { public int localVar = 5; } }Solution
- Illegal Access Modifier in Method Scope :
- The keyword public is not allowed within the body of a method to declare a variable. Variables declared inside methods are considered local variables, and local variables cannot have access modifiers (public, private, protected).
- This results in a compilation error.
More Basics of Computers Questions
दिए गए मुहावरे और कहावतों के अर्थ के लिए चार विकल्प दिए गए �...
निम्नलिखित में शुद्ध वर्तनी है।
' ससुर ' का तत्सम शब्द है __________
'भोले बालक ने क्रूर डाकू के कठोर हृदय में कोमल भावना जगा दी'...
वर्तनी की दृष्टि से इनमें से कौन सा शब्द शुद्ध है ?
' पराजय ' किसका विलोम शब्द है ?
चे + अन का सही सन्धि शब्द है
सूची – I को सूची – II से सुमेलित कीजिए और सूचियों के नीचे दिए �...
महाजन में कौनसा समास है?
निम्नलिखित शब्दों में से तत्सम शब्द चुनिए :