How to Create a Char Type in Java


In this example, we will learn you how to create a char type in Java.

Source Code

package com.beginner.examples;

public class CharType {
  public static void main(String[] args) {
    char letter = 'd'; // char
    System.out.println(letter);
  }
}

Output:

d

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments