हिंदी

Explain the features of Constants.

Advertisements

प्रश्न

Explain the features of Constants.

Explain the features of Constants in JAVA.

स्पष्ट कीजिए
Advertisements

उत्तर

  1. Fixed Value: A constant stores a value that cannot be changed once it is assigned.
  2. Declaration: Constants are declared using the final keyword in Java.
  3. Data Type: Every constant has a specific data type, such as int, float, double or char.
  4. Initialisation: A constant must be assigned a value before it is used, and it can be assigned only once.
  5. Memory Allocation: Constants occupy memory according to their data types.
  6. Naming Convention: Constant names are generally written in uppercase letters, with underscores separating words.
  7. Program Reliability: Constants prevent accidental changes to fixed values, making programs more reliable and easier to maintain.
shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 6: Variables and Expressions - EXERCISE [पृष्ठ १३१]

APPEARS IN

धीरज मेहरोत्रा Computer Science [English] Class 12
अध्याय 6 Variables and Expressions
EXERCISE | Q 7. (ii) | पृष्ठ १३१
धीरज मेहरोत्रा Computer Science [English] Class 12
अध्याय 6 Variables and Expressions
EXERCISE | Q 13. | पृष्ठ १३१
Advertisements
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×