हिंदी

Give examples of the Built in Data Types of Java.

Advertisements

प्रश्न

Give examples of the Built in Data Types of Java.

विस्तार में उत्तर
Advertisements

उत्तर

The examples of built-in data types of Java are as follows:

  1. byte: It is used to store small integer values. Example: byte a = 10;
  2. short: It is used to store integer values. Example: short b = 200;
  3. int: It is used to store whole numbers. Example: int age = 18;
  4. long: It is used to store large integer values. Example: long population = 1000000L;
  5. float: It is used to store decimal numbers with single precision. Example: float marks = 85.5f;
  6. double: It is used to store decimal numbers with double precision. Example: double price = 125.75;
  7. char: It is used to store a single character. Example: char grade = 'A';
  8. boolean: It is used to store logical values, either true or false. Example: boolean result = true;
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 3. | पृष्ठ ११२
Advertisements
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×