In Java, the char keyword is used to declared a variable as a character type. A char variable represents a single character. For example:

char letterA = 'A';

The char keyword can be used to declared return type of a method as well:

public char getALetter() {
    return 'A';
}

See all keywords in Java.

Related Topics:

 

Other Recommended Tutorials:


About the Author:

is certified Java programmer (SCJP and SCWCD). He began programming with Java back in the days of Java 1.4 and has been passionate about it ever since. You can connect with him on Facebook and watch his Java videos on YouTube.



Add comment