byte represents a byte. It is always 8-bits wide. char represents a unicode character, and thus is two bytes (i.e. 16 bits) wide. Use byte[] if you’re dealing with raw bytes, and char[] (or better yet string) if you’re dealing with strings.
byte represents a byte. It is always 8-bits wide. char represents a unicode character, and thus is two bytes (i.e. 16 bits) wide. Use byte[] if you’re dealing with raw bytes, and char[] (or better yet string) if you’re dealing with strings.