Java语言编写,出现 “找不到符号”
Java语言编写,出现 “找不到符号”
正确代码:
class Rectangle
{
int width, height;
int getLength( )
{ return (width + height) * 2;}
void getArea( )
{ System.out.println(“面积为:”+width*height); }
}
class Test
{
public static void main(String[]args)
{
Rectangle rect1=new Rectangle();
//Rectangle rect2=new Rectangle();
rect1.width=10;
rect1.height=20;
int length=rect1.getLength();
System.out.println(“周长:”+length);
//System.out.println(“周长=”+rect1.getLength);
rect1.getArea();
}
}

相关文章:

  • 2021-12-20
  • 2021-12-27
  • 2021-07-27
  • 2021-08-08
  • 2022-12-23
  • 2021-11-21
  • 2022-01-18
  • 2021-06-08
猜你喜欢
  • 2022-12-23
  • 2021-09-04
  • 2021-08-01
  • 2021-08-19
  • 2022-12-23
  • 2021-05-22
相关资源
相似解决方案