[program-java] silly error

  • From: "Stanzel, Susan - Kansas City, MO" <susan.stanzel@xxxxxxxxxxxx>
  • To: "program-java@xxxxxxxxxxxxx" <program-java@xxxxxxxxxxxxx>
  • Date: Mon, 7 Mar 2011 14:27:06 -0600

Hi Listers,

This says that getVolume cannot be resolved to a type. What is wrong?

package exercises;

public class Box {
      double height, width, depth;
      Box(double h, double w, double d) {
            height = h;
            width = w;
            depth = d;

            public double getVolume() {
                  return volume = (height * width * depth);


This will have a testing class where I will pass in the three numbers. I have 
been struggling with this all day.



Other related posts: