Java-Boolean

Boolean Boolean type is used when we want to test a particular condition during the execution of the program. There are only two values that a boolean type can take : true or false. Boolean type is denoted by the keyword boolean. Program Program Source class Javaapp { public static void main(String[] args) { boolean bo … Read more…

Java-Unicode to Represent Characters

Unicode to Represent Characters Character have numeric values. For example, the character ‘C’ is actually encoded as 67. Because, Java uses Unicode to represent characters. Unicode defines a fully international character set that can represent all of the characters found in all human languages. It is a unification of dozens of character sets, such as … Read more…

Java-Character

Character A single character that is written inside single quotation marks is defined as a character constant. The default size that is made available for a char type constant is 2 bytes. A char type variable can store only a single character. Program Program Source class Javaapp { public static void main(String[] args) { char … Read more…

Java-Floating Point

Floating Point Types Integer types can hold only whole numbers and therefore we use another type known as floating point type to hold numbers containing fractional parts such as 50.55 and 2.344. There are two kinds of floating point storage in Java. Type Size Description float 4 byte The type float specifies a single-precision value. Variable … Read more…

Java-Variables

Variables A variable is an identifier that denotes a storage location in which a value is stored. A variable may take different values during the execution of a program. Since Java is case-sensitive, uppercase letters and lowercase letters are distinct in Java. Thus the variable name sum is not the same as the variable name … Read more…