Search

Why Java take 2 byte memory for char ?



Java take 2 byte for char

  • Java support all 18 international languages so java take 2 byte for characters, because for 18 international language 1 byte of memory is not sufficient for storing all characters and symbols present in 18 languages.
  • Java supports Unicode but c support ascii code.
  • In ascii code only English language are present, so for storing all English latters and symbols 1 byte is sufficien.