java char at code example
Example 1: get certain character from string java
String words = "Hi There";
char index = words.charAt(0);
System.out.println(index);
Example 2: character at index of string java
String str = "Grepper";
char ch = str.charAt(0);
Example 3: what is a char in java
Character ch = new Character('a');
Example 4: string char at java
char ch=name.charAt(4);
Example 5: char.at java
public class EsempioCharat {
public static void main(String args[]) {
String str = "informaticappunti.it";
char ch1 = str.charAt(0);
char ch2 = str.charAt(5);
System.out.println("Il carattere all'indice 0 è: "+ch1);
System.out.println(" Il carattere all'indice 5 è: "+ch2);
}
}
Example 6: what is a char in java
char ch = 'a';
char uniChar = '\u03A9';
char[] charArray = { 'a', 'b', 'c', 'd', 'e' };