1. Resolve the use of names in the following Java program:
    public class foobar {
        public foobar foobar = foobar();
    
        public foobar() {}
    
        public foobar foobar() {
            foobar foobar = new foobar();
            return foobar.foobar();
        }
    
        public static void main(String[] args) {
            new foobar().foobar().foobar.foobar();
        }
    }
    

  2. We now modify the program by adding a package name:
    package foobar;
    
    public class foobar {
        public foobar.foobar foobar = foobar();
    
        public foobar() {}
    
        public foobar.foobar foobar() {
            foobar.foobar foobar = new foobar();
            return foobar.foobar();
        }
    
        public static void main(String[] args) {
            new foobar.foobar().foobar().foobar.foobar();
        }
    }
    
    Explain how this changes the behavior of the name resolution.

  3. Construct a Java program that violates all the hierarchy well-formedness constraints.

  4. Fun challenge: construct a (legal?) Java program that crashes SUN's Java compiler during name resolution.