aliensbrain
  • Home
  • Topics
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • Basic Java Programming Quiz
  • What is the size of a Char?...
Multiple choice java

What is the size of a Char?

  1. 4 bits

  2. 7 bits

  3. 8 bits

  4. 16 bits

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

In modern programming environments like .NET and Java, the 'char' type uses UTF-16 encoding to support international characters. This requires 16 bits (2 bytes) per character, unlike the older ASCII standard which used 8 bits.

Keep practicing — related questions

  • After the declaration: char[] c = new char[100]; what is the value of c[50]?
  • int x = 12; while (x < 10) { x--; } System.out.print(x); What is the result?
  • String[] elements = { "for", "tea", "too" }; String first = (elements.length > 0) ? elements[0] : null; Wha...
  • public static void main(String[] args) { String str = "null"; if (str == null) { System.out.println("null")...
  • public class Yippee2 { static public void main(String [] yahoo) { for(int x = 1; x < yahoo.length; x++) { S...
  • NumberFormat nf = NumberFormat.getInstance(); nf.setMaximumFractionDigits(4); nf.setMinimumFractionDigits(2...
  • System.out.format("Pi is approximately %d.", Math.PI); What is the result?
  • int x = 12; while (x < 10) { x--; } System.out.print(x); What is the result?
Play the full quiz 🎤 Practise this topic out loud
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy