हिंदी

What are the possible scope categories for a Java variable?

Advertisements

प्रश्न

What are the possible scope categories for a Java variable?

लघु उत्तरीय
Advertisements

उत्तर

  1. Local Variables: These variables are defined within a method, constructor, or block. Their accessibility is limited to that particular method or block.
  2. Instance Variables: These variables are defined at the class level without the static keyword. Each object of the class maintains its own copy of these variables.
  3. Static (Class) Variables: These variables are declared using the static keyword within a class. A single copy is shared by all objects of that class.
shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 6: Variables and Expressions - SHORT ASSIGNMENTS [पृष्ठ १३६]

APPEARS IN

धीरज मेहरोत्रा Computer Science [English] Class 12
अध्याय 6 Variables and Expressions
SHORT ASSIGNMENTS | Q 28. | पृष्ठ १३६
Advertisements
Share
Notifications



      Forgot password?
Use app×