Loading...

Category: Java

Boolean Literals

Boolean type values are true or false only in lower case.Example:1. boolean b=false; //(valid)2. boolean b=0; //(invalid)3. boolean b=False; //(invalid)4. boolean b=”false”; //(invalid)

Floating Point Literals

Floating point literals is by default double type. But it can be explicitly as float type by suffixing with f or F.Example:float f=123.546; //(invalid)float f=123.546f; //(valid)double d=123.546; //(valid) Floating point [ … ]

Literals

Any constant value which are assigned to the variables are called literal. Example:int x=10 int —-> datatype|keywordx ——-> name of variable|identifier10 —–> constant value|literal

Char Data Type

Char Data Type:In previous languages like C and C++ are ASCII code based the number of ASCII code characters are <256 to represent these 256 characters 8-bits enough hence char [ … ]

Data Types

Data type is a keyword used to  identify type of  data. Data types in java are defined as specifiers that allocates space and type of values stored in the variable/identifiers. [ … ]