Decompiler Casting Test Source

Program-Transformation.Org: The Program Transformation Wiki
This program is from the book Decompiling Java, chapter 1.
public class Casting {
    public static void main(String args[]){
        for(char c=0; c < 128; c++) {
            System.out.println("ascii " + (int)c + " character "+ c);
The only real trick here is the cast to integer in the call to println, although it would be nice for the decompiler to type for loop variable (here c) as a char rather than as an integer.

It's surprising how many decompilers fail this simple test.

-- MikeVanEmmerik - 13 Feb 2003