##
__Booleans__

Ã¼Size is 1 bit – two value: true and
false.
Ã¼This type is returned by all
relational operators.

Ã¼__Example:__

boolean b;
b= true;
System.out.println(“b is “+b);
System.out.println(“10>9 is “
+(10>9));

__Output:__

b is
true
10>9
is true
__Literals__

Ã¼Integer Literals

1. base 10 – 1,2,43 etc.
2. base 8 – octal values are denoted in java
by a leading 0.
3. base 16 – hexadecimal values are denoted by
leading 0x or 0X.

}Any whole number is by default
integer (32 bits).
}To specify a long literal, the
number should appended with
an upper- or lowercase L.

Ã¼Floating point Literals

1. Standard Notation – 3.14159, 0.6667, 2.0
etc.
2. Scientific Notation – 6.022E23, 2e+100.
}Floating point literals are by
default of type double.
}To specify a float literal, we must
append an F or f to the constant.

Ã¼Boolean Literals

}Two values – true and false.
}True is not equal 1 and false is
not equal to 0.
}They can be assigned to variable
declared as boolean.

Ã¼Character Literals:

}A literal character is represented
inside a pair of single quotes.

Ã¼String Literals

}A sequence of characters between a
pair of double quotes.
}In java string must begin and end
on the same line.

__Booleans__

Ã¼Size is 1 bit – two value: true and
false.

Ã¼This type is returned by all
relational operators.

Ã¼

__Example:__

boolean b;

b= true;

System.out.println(“b is “+b);

System.out.println(“10>9 is “
+(10>9));

__Output:__

b is
true

10>9
is true

__Literals__

Ã¼Integer Literals

1. base 10 – 1,2,43 etc.

2. base 8 – octal values are denoted in java
by a leading 0.

3. base 16 – hexadecimal values are denoted by
leading 0x or 0X.

}Any whole number is by default
integer (32 bits).

}To specify a long literal, the
number should appended with

an upper- or lowercase L.

Ã¼Floating point Literals

1. Standard Notation – 3.14159, 0.6667, 2.0
etc.

2. Scientific Notation – 6.022E23, 2e+100.

}Floating point literals are by
default of type double.

}To specify a float literal, we must
append an F or f to the constant.

Ã¼Boolean Literals

}Two values – true and false.

}True is not equal 1 and false is
not equal to 0.

}They can be assigned to variable
declared as boolean.

Ã¼Character Literals:

}A literal character is represented
inside a pair of single quotes.

Ã¼String Literals

}A sequence of characters between a
pair of double quotes.

}In java string must begin and end
on the same line.

## No comments:

## Post a Comment