Which of the following is false? ( )
A: A static method must be used to access private static instance variables.
B: A static method can be accessed even when no objects of its class have been instantiated.
C: A static method has no this reference.
D: A static method can call instance methods directly.
A: A static method must be used to access private static instance variables.
B: A static method can be accessed even when no objects of its class have been instantiated.
C: A static method has no this reference.
D: A static method can call instance methods directly.
举一反三
- An instance member() A: is also called a static member B: is always a variable C: is never a method D: belongs to a single instance, not to the class as a whole E: always represents an operatio
- An instance member() A: is also called a static member B: is always a variable C: is never a method D: belongs to a single instance, not to the class as a whole E: always represents an operation
- 定义一个同包中的类可以访问的、无参、无返回值的静态方法method,以下哪个方法可以() A: voidmethod() B: public static method() C: protected static voidmethod() D: private static void method( )
- 在下列方法定义中,方法头不正确的是( )。 A: public int method( ){...} B: public static int method(double y){...} C: void method(double d){...} D: public static method(double a){...}
- 为A类的一个有一int形式参数a无返回值的方法method书写方法头,使得使用类名就可以调用它,该方法头的形式为( )。 A: static void method( ) B: public void method(int a ) C: static void method( int a) D: public static method(int a )