Typically for local variables I initialize them as late as I can. It's rare that I need a "dummy" value. However, if you do, you can use any value you like - it won't make any difference, if you're sure you're going to assign a value before reading it.

If you want the char equivalent of 0, it's just Unicode 0, which can be written as

char c = '\0';

That's also the default value for an instance (or static) variable of type char.

Answer from Jon Skeet on Stack Overflow
🌐
W3Schools
w3schools.com › Java › ref_keyword_char.asp
Java char Keyword
Java Examples Java Videos Java Compiler Java Exercises Java Quiz Java Code Challenges Java Practice Problems Java Server Java Syllabus Java Study Plan Java Interview Q&A ... The char keyword is a data type that is used to store a single character.
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › lang › Character.html
Character (Java Platform SE 8 )
September 23, 2026 - Java™ Platform Standard Ed. 8 ... The Character class wraps a value of the primitive type char in an object.
🌐
W3Schools
w3schools.com › java › java_data_types_characters.asp
Java Data Types Characters
Java Examples Java Videos Java Compiler Java Exercises Java Quiz Java Code Challenges Java Practice Problems Java Server Java Syllabus Java Study Plan Java Interview Q&A ... The char data type is used to store a single character.
🌐
Tutorialspoint
tutorialspoint.com › java › char_keyword_in_java.htm
Java - char Data Type
Java char is a primitive data type and it is used to create character (char) type variables that can accept a single character. A char variable represents a reserved memory location to store char values.
🌐
CodeGym
codegym.cc › java blog › java types › char data type in java
Char Data Type in Java
April 24, 2025 - The char data type in Java is a primitive type that holds a single character, like a letter, digit, or symbol. It's stored in 16 bits (2 bytes), unlike some languages that use 8 bits, giving it room for 65,536 possible values.
Find elsewhere
🌐
Oxford University
mathcenter.oxford.emory.edu › site › cs170 › charType
The char Data Type
Java · Data Structures · Cornerstones · Calculus · The char type is used to store single characters (letters, digits, symbols, etc...). Remember, when values of variables are stored in the computer's memory, they must ultimately be stored in terms of only 1's and 0's.
🌐
Coddy.Tech
coddy.tech › learn › java › char
char – Java | Coddy
August 7, 2026 - Store the char C in a variable named initial.
🌐
Medium
amn24.medium.com › java-day-12-fbda745dd919
Java Day_12. Java Notes: Character Literals (char) | by Aman Verma | Medium
September 29, 2025 - In Java, the char data type is a 16-bit unsigned integer used to store a single Unicode character. Its value can range from 0 to 65,535. You can declare a char literal in several ways. a) In Single Quotes: The most common way is to enclose a ...
🌐
iO Flood
ioflood.com › blog › java-char
Char Data Type in Java: How to Declare and Use
February 26, 2024 - In Java, the char keyword is used to declare a character variable. It’s a primitive data type, which means it’s built into the Java language itself.
🌐
Study.com
study.com › business courses › java programming tutorial & training
Java: Char Data Type - Lesson | Study.com
August 11, 2020 - You'd think that a char could be any value from A to Z, and all the numbers. That is true, except for one key item. You can either declare a char variable with single quotes, e.g., setting a char's value to the letter a.
🌐
Quora
quora.com › How-do-I-declare-a-char-variable-in-Java-and-give-inputs
How to declare a char variable in Java and give inputs - Quora
Answer (1 of 7): Thanks for A2A :) Declaring Variable and giving Inputs in Java can be done in 2 Steps. Step-1 Declaring Variable Syntax to declare any variable in Java is : Datatype variable_name; OR Datatype variable_name = value; For example to create an char and int variable, char c; ...
🌐
W3Schools
w3schools.com › java › java_variables.asp
Java Variables
String values are surrounded by ... point numbers, with decimals, such as 19.99 or -19.99 · char - stores single characters, such as 'a' or 'B'. Char values are surrounded by single quotes...
🌐
Tutorialspoint
tutorialspoint.com › java › java_characters.htm
Java - Character Class
public final class Character extends Object implements Serializable, Comparable<Character> Following are the fields for java.lang.Character class −
🌐
DataCamp
datacamp.com › doc › java › char
char Keyword in Java: Usage & Examples
Learn how to use the `char` keyword in Java to store and manipulate 16-bit Unicode characters with examples and best practices. Master character handling in Java efficiently.
🌐
Oracle
docs.oracle.com › javase › tutorial › java › nutsandbolts › datatypes.html
Primitive Data Types (The Java™ Tutorials > Learning the Java Language > Language Basics)
A literal is the source code representation of a fixed value; literals are represented directly in your code without requiring computation. As shown below, it's possible to assign a literal to a variable of a primitive type: boolean result = true; char capitalC = 'C'; byte b = 100; short s = 10000; int i = 100000;