填空题以下程序的输出结果为______。 public class Tom private float weight; private static String name; public void setWeight(float weight) this.weight = weight; private void out______ System.out.println(name + "体重:" + weight + "斤"); public static void main(String[] args) Tom.name = "汤姆猫"; Tom cat = new Tom______; cat.setWeight(20); cat.out______;
填空题开发与运行Java程序需要经过的三个主要步骤为______、______和______。
填空题public class Sum public static void main(String [] args) int j=10; System.out.println("j is : "+j); calculate(j); System.out.println("At last, j is : "+j); static void calculate (int j) for (int i = 0;i j++; System.out.println("j in calculate() is: "+j); 输出结果为: j is : (1) j in calculate() is : (2) At last j is : (3)
填空题下列程序的运行结果是______。 public class MyClass int a[] = 1, 2, 3, 4, 5 ; void out______ for (int j = 0; j < a.length; j++) System.out.print(a[j] + ""); public static void main(String[] args) MyClass my = new MyClass______; my.out______;
填空题当声明一个数组int arr[] = new int[5]; 时,这代表这个数组所保存的变量类型是______,数组名是______,数组的大小为______,数组元素下标的使用范围是______。
填空题导入mypackage包中的所类的命令是______。
填空题若x=5,y=10,则x<y和x>=y的逻辑值分别为______和______。
填空题Java中用于两个数相等比较的运算符是:______,用于不相等比较的运算符是______。
填空题如果一个Java Applet程序文件中定义有3个类,则使用Sun公司的JDK编译器______编译该源程序文件将产生______个文件名与类名相同而扩展名为______的字节码文件。
填空题Java中用于定义小数的关键字有两个:______和______,后者精度高于前者。
填空题以下程序的输出结果为______。 public class Person String name; int age; public Person(String name, int age) this.name = name; this.age = age; public static void main(String[] args) Person c = new Person("Peter", 17); System.out.println(c.name + " is " + c.age + " years old!");
填空题Java程序中的单行注释符是______,多行注释符是______。
填空题以下程序段的输出结果是______ int x = 5, y = 6, z = 4; if (x + y > z else System.out.println("不是三角形");
填空题阅读程序,给出结果: // AbstractClassDemo.java源代码如下: abstract class Shape //定义抽象类Shape和抽象方法display abstract void display(); class Circle extends Shape void display() //实现抽象类的方法 System.out.println("Circle"); class Rectangle extends Shape void display() //实现抽象类的方法 System.out.println("Rectangle"); class Triangle extends Shape void display() //实现抽象类的方法 System.out.println("Triangle"); public class AbstractClassDemo public static void main(String args[]) (new Circle()).display(); //定义无名对象来调用对应的display方法 (new Rectangle()).display(); (new Triangle()).display(); 输出结果是 ?
填空题设有数组定义:int MyIntArray[ ] = 10, 20, 30, 40, 50, 60, 70; 则执行以下几个语句后的输出结果是______。 int s = 0 ; for ( int i = 0 ; i < MyIntArray.length ; i + + ) if ( i % 2 = = 1 ) s+= MyIntArray[i] ; System.out.println( s );
填空题Socket通常也称为______,用于描述______和______。
填空题下面程序段的执行结果是______ int a[] = 2, 3, 4, 5, 6 ; for (int i = a.length - 1; i >= 0; i--) System.out.print(a[i] + "");
填空题如果将类MyClass声明为public,它的文件名称必须是______才能正常编译。
填空题在多线程系统中,多个线程之间有______和______两种关系。
填空题定义类的保留字是______,定义接口的保留字是______。
