char.At java code example
Example 1: character at index of string java
String str = "Grepper";
char ch = str.charAt(0);
Example 2: what is a char in java
Character ch = new Character('a');
Example 3: string char at java
char ch=name.charAt(4);
Example 4: 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 5: what is a char in java
char ch = 'a';
char uniChar = '\u03A9';
char[] charArray = { 'a', 'b', 'c', 'd', 'e' };