Код: Выделить всё
public class CratingObjects
{
public class Rectangle
{
double length;
double breadth;
double calculatingArea()
{
return (length*breadth);
}
double calculatingPerimeter()
{
return((2*length)+(2*breadth));
}
void setLength(double length)
{
this.length = length;
}
void setBreadth(double breadth)
{
this.breadth = breadth;
}
double getLength(double length)
{
return length;
}
double getBreadth(double breadth)
{
return breadth;
}
}
public static void main(String[] args)
{
System.out.println("Rectangle Object");
Rectangle r1 = new Rectangle();
}
}
Почему я столкнулся с этой ошибкой?
Подробнее здесь: https://stackoverflow.com/questions/790 ... m-a-static