> I am working directly out of a beginning programmers book and trying
> to type out this example. I have two questions.
[quoted text clipped - 9 lines]
> the error that no enclosing instance type C5E1 is accessable. Must
> qualify the allocation with an enclosing instance of type C5E1.
You declared Rectangle as an inner class. That means it requires an instance
of the enclosing class to exist. You did not create such an instance.
> -----------------------------------------------------------------------------------------------------------------------------------
> public class C5E1 {
> public static void main(String[] args)
It is not wise to embed TAB characters in Usenet posts.
> {
> //create rectangle
> Rectangle r1 = new Rectangle();
What you need is
Rectangle r1 = new C5E1().new Rectangle();
> }//end main
>
[quoted text clipped - 3 lines]
> private double height = 1;
> private static String color = "white";
You cannot declare non-final, non-compile-time-constant static fields in inner
classes.
<http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.1.3>
> An inner class is a nested class that is not explicitly or implicitly declared static.
> Inner classes may not declare static members, unless they are compile-time constant fields (§15.28).

Signature
Lew