मराठी

Explain the char Data Type with an Example.

Advertisements

प्रश्न

Explain the char Data Type with an Example.

स्पष्ट करा
Advertisements

उत्तर

The char data type is a primitive data type in Java that is used to store a single character, such as a letter, digit or special symbol. It is a 16-bit unsigned data type that occupies 2 bytes of memory. It stores characters using the Unicode character set, with values ranging from 0 to 65,535.

Example:

char grade = 'A';

In the above example, char specifies the data type, grade is the variable name, and 'A' is the character value assigned to the variable.

shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 5: Primitive Values, Wrapper Classes, Types and Casting - EXERCISE [पृष्ठ ११२]

APPEARS IN

धीरज मेहरोत्रा Computer Science [English] Class 12
पाठ 5 Primitive Values, Wrapper Classes, Types and Casting
EXERCISE | Q 4. (g) | पृष्ठ ११२
धीरज मेहरोत्रा Computer Science [English] Class 12
पाठ 6 Variables and Expressions
EXERCISE | Q 6. | पृष्ठ १३१
Advertisements
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×