A: static int account;
B: int static account;
C: static public int account;
D: static account;
举一反三
- 下面语句中定义静态方法,正确的是()。 A: static int f(){}; B: int static f(); C: static public int f(); D: static f();
- 下面语句中定义静态方法,正确的是()。 A: static int f(){}; B: int static f(); C: static public int f(); D: static f();
- 下面语句中定义静态方法,正确的是()。 A: static int f(){}; B: int static f(); C: static public int f(); D: static f();
- 以下是"public static void test(int x, int y)"的方法重载( ) A: public static void Test(int x) B: public static int test(int x, int y) C: public static void test(int y, int x) D: public static void test(int x, int y)
- Test类中声明一个整型静态成员函数fun()的正确语句是_____。 A: int static fun(); B: int fun() static; C: static int fun(); D: int Test::fun() static;
内容
- 0
定义一个名为f1的方法,该方法有两个整型参数,返回值为两个参数的乘积,正确的定义为( ) A: public static void f1(int a,b){…} B: public static int f1(int a,b){…} C: public static void f1(int a,int b){…} D: public static int f1(int a,int b){…}
- 1
static int *p; 这是定义了一个指针。变量p的数据类型为( ) A: int * B: int C: static int D: static
- 2
定义如下方法,下面选项中()错误的实现对该方法的重载。public static String do(int n,String s){......} A: public static int do(int num,String s){......} B: public static String do(String s,int n){......} C: public static void do(String s,int value) {......} D: public static void do(){......}
- 3
下列定义数组的语句中不正确的是(). A: static int a[2][3]={1,2,3,4,5,6}; B: static int a[2][3]={{1},{4,5}}; C: static int a[][3]={{1},{4}}; D: static int a[][]={{1,2,3},{4,5,6}};
- 4
Java程序如果有main方法,main方法之前的修饰符为( )。 A: public int static B: public static int C: public void static D: public static void