• 2022-06-01
    下列哪些是正确的声明变量的方式?
    A: int length; int width;
    B: int length, width;
    C: int length; width;
    D: int length, int width;
  • A,B

    举一反三

    内容

    • 0

      设置图像尺寸的属性是()和“height”。 A: “width” B: “length” C: “int” D: “mm”

    • 1

      【多选题】已知代码如下 class Rectangle { private int width, height; public void setSize(int width, int height) { this.width = width; this.height = height; } } 下面哪些代码重载 setSize 方法 (10.0分) A. protected void setSize(int width, int height) { this(width, height) } B. public void setSize(int width, float height) { this.width = width; this.height = (int)height; } C. protected void setSize(int width) { this.width = width; } D. public void setSize(int height, int width) { this.width = width; this.height = height; }

    • 2

       定义一个 Rectangle 类,有长 itsWidth 、宽 itsLength 等属性,重载其构造函数 Rectangle() 和 Rectangle(int width ,int length) 。

    • 3

      int intArray[]={0,2,4,6,8}; int length=int Array.length();()

    • 4

      下列代码的执行结果是: int length = "Hello".length(); System.out.println(length);