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