Boolean and Char Data Type in Java || Lesson 6 || Java Programming || Learning Monkey ||

Published: 02 April 2023
on channel: Wisdomers - Computer Science and Engineering
886
13

Boolean and Char Data Type in Java
In this class, We discuss Boolean and Char Data Type in Java.
The reader should know about integer and floating point data types in java. Click Here.
Boolean:
The boolean data type will take only two values. True or false.
boolean a = true;
The variable a is taking the true value.
Character:
The character data type is used to store a character.
Example:
char b =’A’;
b is a variable of type character.
The variable b will hold a character in upper case A.
We use single quotes to represent characters in java.
The character data type will take 2 bytes of memory.
Computers are capable of storing binary digits.
To store a character, we need to convert the character to binary.
Each character should assign a unique number.
We need a standard for the conversion of characters.
Java uses 16-bit Unicode characters.
List of 16-bit Unicode characters: Click Here
The upper case A is given a decimal value of 65.
The above link shows in hexadecimal value.
The hexadecimal value for upper case A is 0041.
If we convert the hexadecimal 0041 to decimal, we get 65.
The below program shows the example to display the value 65 to upper case A.
char x = ‘A’;
int b = (int)x;
System.out.println(b)
Output: 65

Link for playlists:
   / @wisdomerscse  


Link for our website: https://learningmonkey.in

Follow us on Facebook @   / learningmonkey  

Follow us on Instagram @   / learningmonkey1  

Follow us on Twitter @   / _learningmonkey  

Mail us @ learningmonkey01@gmail.com


On this page of the site you can watch the video online Boolean and Char Data Type in Java || Lesson 6 || Java Programming || Learning Monkey || with a duration of hours minute second in good quality, which was uploaded by the user Wisdomers - Computer Science and Engineering 02 April 2023, share the link with friends and acquaintances, this video has already been watched 886 times on youtube and it was liked by 13 viewers. Enjoy your viewing!