Chars

=Chars=

A char is a single character. The data is stored in a single byte or 8 bits and can often be used a an integer in most programming languages. When declared a character must be between single quotes.

In C++
Initializing a char is pretty straight forward in c++. If you create a character array in c++ the final character will always be a '\0' (null) character. code format="cpp" main{ char myChar = 'a';

char myString[] = "Hello"; char sameString[] = {'H', 'e', 'l', 'l', 'o', '\0'}; } code

In Java
Initializing a char in Java is very similar. code format="java" public class StringDemo{ public static void main(String[] args){ char myChar = 'a';

System.out.println(finalString); } } code