举一反三
- int(5.5).bit_length()的结果是 A: 4 B: 6 C: 3 D: 5
- 下列代码的执行结果是: int length = "Hello".length(); System.out.println(length);
- 下列代码的执行结果是____。 Int length="Hello".length(); System.out.println(length); A: 5 B: 2 C: 10 D: 6
- 下列哪些是正确的声明变量的方式? A: int length; int width; B: int length, width; C: int length; width; D: int length, int width;
- 定义类A和类B如下,得到结果是class A{int x;A(int i)...s A{double b=5.5;}
内容
- 0
下列程序的输出结果为 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()); }}
- 1
以下C的程序片段输出的结果是( )。char p[20]; char *s = "Data"; int length = strlen(s); int i; for (i = 0; i < length; i++) p[i] = s[length - i]; printf("%s", p);[/i] A: 输出是空白 B: data C: atad D: adat
- 2
定义类A和类B如下,得到结果是 class A{ int x; A(int i){x=i;} } class B extends A{ double b=5.5; }
- 3
5.5执行下列语句:float a; int b; a = b =24.5/5; printf(“%f,%d”, a, b);输出结果是______ 。
- 4
int intArray[]={0,2,4,6,8}; int length=int Array.length();()