Answer to Question #282813 in Java | JSP | JSF for Ismat

Question #282813

Write a program in java to store A to Z alphabets in a single dimension array then display the letters in one column and their UNICODE in another column with appropriate heading as follows:

Index No.  Letters  UNICODE

0   A           65

1   B          66


1
Expert's answer
2021-12-26T09:41:14-0500






public class App {


	/**
	 * The start point of the program
	 * 
	 * @param args
	 * 
	 */
	public static void main(String[] args) {
		char alphabets[] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
				'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' };
		System.out.printf("%-15s%-15s%-15s\n", "Index No.", "Letters", "UNICODE");


		for (int i = 0; i < alphabets.length; i++) {
			System.out.printf("%-15d%-15c%-15d\n", i, alphabets[i], (int) alphabets[i]);
		}
	}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog