More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know.
Core Java - Interview Questions and Answers for 'Ascii' - 4 question(s) found - Order By Newest
Q1. How many bits are used to represent Unicode, ASCII, UTF-16, and UTF-8 characters?
Ans. Unicode requires 16 bits and ASCII require 7 bits. Although the ASCII character set uses only 7 bits, it is usually represented as 8 bits. UTF-8 represents characters using 8, 16, and 18 bit patterns. UTF-16 uses 16-bit and larger bit patterns.
Help us improve. Please let us know the company, where you were asked this question :
Ans. It will result in compilation error as primitive char cannot be casted to Integer object, alternatively we can cast it to primitive int like following
System.out.println((int)'a');
Help us improve. Please let us know the company, where you were asked this question :