I get the error test cannot be resolved to a type here
test[] arrayOftest = new test[ 3 ];
- ideas or help?
public class Test {
public static void main( String args[] )
{
Point point = new Point( 3, 3 );
Square square = new Square( 7, 7, 7 );
Cube cube = new Cube( 2.2, 3 , 3 );
test[] arrayOftest = new test[ 3 ];
String result = "";
arrayOftest[ 0 ] = point;
arrayOftest[ 1 ] = square;
arrayOftest[ 2 ] = cube;
result += point.getName() + ": " +
point.toString();
result += "\n" + square.getName() + ": " +
square.toString();
result += "\n" + cube.getName() + ": " +
cube.toString();
for ( int i = 0; i < 3; i++ ) {
result += "\n" + arrayOftest[ i ].getName() +
": " + arrayOftest[ i ].toString();
result += "\n" + "Area = " +
arrayOftest[ i ].area();
result += "\n" + "Volume = " +
arrayOftest[ i ].volume();
}
JOptionPane.showMessageDialog(
null, result, "Shapes",
JOptionPane.INFORMATION_MESSAGE );
System.exit( 0 );
}
}