What compiler is saying is that it does not know where the type Rational is defined. Yes, you can create object in the code block of the for loop.
According to google the type Rational is not defined in the package acm
rational site:www-cs-faculty.stanford.edu/~eroberts/jtf/javadoc/student/acm/
so it must have been defined somewhere else.
It does not look it belongs to built-in java types either http://docs.oracle.com/javase/7/docs/api/