मराठी

Explain the Boolean data type with an Example.

Advertisements

प्रश्न

Explain the Boolean data type with an Example.

स्पष्ट करा
Advertisements

उत्तर

The boolean data type is a primitive data type in Java that is used to store logical values. It can store only two values: true or false. It is mainly used in conditional statements, comparisons and decision-making operations.

Example:

boolean isPassed = true;

In the above example, boolean specifies the data type, isPassed is the variable name, and true is the logical 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. (f) | पृष्ठ ११२
Advertisements
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×