मराठी

Explain the various Primitive Types of Java.

Advertisements

प्रश्न

Explain the various Primitive Types of Java.

स्पष्ट करा
Advertisements

उत्तर

  1. Integer Data Types: Integer data types are used to store whole numbers without decimal points. Java provides four integer data types:
    • byte: It is an 8-bit data type that occupies 1 byte of memory and stores small integer values.
    • short: It is a 16-bit data type that occupies 2 bytes of memory and stores integer values.
    • int: It is a 32-bit data type that occupies 4 bytes of memory and is commonly used to store whole numbers.
    • long: It is a 64-bit data type that occupies 8 bytes of memory and is used to store large integer values.
  2. Floating-Point Data Types: Floating-point data types are used to store numbers containing decimal points. Java provides two floating-point data types:
    • float: It is a 32-bit data type that occupies 4 bytes of memory and stores decimal values with approximately 6–7 significant digits of precision.
    • double: It is a 64-bit data type that occupies 8 bytes of memory and stores decimal values with approximately 15–16 significant digits of precision.
  3. Character Data Type: The char data type is used to store a single Unicode character. It occupies 2 bytes (16 bits) of memory and can represent letters, digits and special symbols.
  4. Boolean Data Type: The boolean data type is used to store logical values, which can be either true or false. It is mainly used in conditional statements and decision-making operations.
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 1. | पृष्ठ ११२
Advertisements
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×