
how to display characters stored in array in core java

Java Character Array
class CharacterArray
{
public static void main(String[] args)
{
char ch[]={'A','B','C','D','E'};
for(int i=0;i<ch.length;i++){
System.out.println(ch[i]);
}
}
}

class DisplayChars {
public static void main(String args[]) {
char[] array={'d','i','s','p','l','y'};
// by using for-each loop
for(char c : array)
System.out.println(c);
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.