下列代码的执行结果是____。 Int length="Hello".length(); System.out.println(length);
A: 5
B: 2
C: 10
D: 6
A: 5
B: 2
C: 10
D: 6
举一反三
- 下列代码的执行结果是: int length = "Hello".length(); System.out.println(length);
- 下列哪些是正确的声明变量的方式? A: int length; int width; B: int length, width; C: int length; width; D: int length, int width;
- 下列程序的输出结果为 class Box{ int length,width,height; public void setInfo(int l,int w,int h){ length = l; width = w; height = h; } public int volumn(){ return length*width*height; } public int area(){ return (length*width + length*height + width*height) * 2; } public String toString(){ return "Length:" + length + " width:" + width + " height:" + height + " volumn: " + volumn() + " area:" + area(); }} public class BoxTest { public static void main(String[] args) { Box b = new Box(); b.setInfo(5,2,4); System.out.println(b.toString()); }}
- 如果length=3,则以下代码:<;view wx:if="{{length >; 5}}">;1<;/view>;<;view wx:elif="{{length >; 2}}">;2<;/view>;<;view wx:else>;3<;/view>;的输出结果为( ) A: 1 B: 2 C: 3 D: 4
- 如果length=3,则以下代码: 5}}>1 2}}>23的输出结果为(