Professional Documents
Culture Documents
Binary, Length of String, Ascii Values
Binary, Length of String, Ascii Values
1010
10101
11111
1. tring s="hello";
2. char c=s.charAt(0);//returns h
Test it Now
Output:
Test it Now
Output:
ASCII is an acronym that stands for American Standard Code for Information
Interchange. In ASCII, a specific numerical value is given to different
characters and symbols, for computers to store and manipulate, and while
storing and manipulating the electronic device always works with the binary
value of the ASCII number given. As it is impossible to do that in the original
form.
In order to find the ASCII value of a character, simply assign the character to a
new variable of integer type. Java automatically stores the ASCII value of that
character inside the new variable.
Implementation: Brute force Method
Java
Output
Java
Output
The ASCII value of } is: 125