Yes, you can do it like this:
for (char alphabet="A"; alphabet <= 'Z'; alphabet++) {
System.out.println(alphabet);
}
It is also possible with typecasting:
for (int i = 65; i <= 90; i++) {
System.out.println((char)i);
}
More Related Contents:
- Hibernate Auto Increment ID
- Is there a way to retrieve the autoincrement ID from a prepared statement
- Auto-increment a value in Firebase
- Java Look and Feel (L&F) [closed]
- How do I get a platform-dependent new line character?
- Why is Java’s SimpleDateFormat not thread-safe? [duplicate]
- Java time-based map/cache with expiring keys [closed]
- Does Java casting introduce overhead? Why?
- Right way to implement equals contract [duplicate]
- How do I read input character-by-character in Java?
- How do I analyze a .hprof file?
- When does the JPA set a @GeneratedValue @Id
- Servlet Mapping using web.xml
- Java: unparseable date exception
- Android Layout with ListView and Buttons
- What is an “internal address” in Java?
- Why does java app crash in gdb but runs normally in real life?
- How to get location of a mouse click relative to a swing window
- How to get local application data folder in Java? [duplicate]
- How to show digital PDF signature in all document’s Page using iText?
- What is the difference between PermGen and Metaspace?
- How to pass Table-Valued parameters from java to sql server stored procedure?
- javac : Compiling a .java file which uses other classes in it
- How to implement a SQL like ‘LIKE’ operator in java?
- Prevent the keyboard from displaying on activity start
- Registering beans(prototype) at runtime in Spring
- Getting directory path to .class file containing main
- How to build and run Maven projects after importing into Eclipse IDE
- Boolean checking in the ‘if’ condition
- Tomcat – CATALINA_BASE and CATALINA_HOME variables