多项选择题

Given the following class, which statements can be inserted at position 1 without causing the code to fail compilation?()  
public class Q6db8 {  
int a;  
int b = 0;  
static int c;  
public void m() {  
int d;  
int e = 0;  
// Position 1  
}  
} 

A.a++;
B.b++;
C.c++;
D.d++;
E.e++;


您可能感兴趣的试卷

你可能感兴趣的试题

2.单项选择题How do objects pass messages in Java?()   

A.They pass messages by modifying each other’s member variables
B.They pass messages by modifying the static member variables of each other’s classes
C.They pass messages by calling each other’s instance member methods
D.They pass messages by calling static member methods of each other’s classes.

3.多项选择题

Given that Thing is a class, how many objects and reference variables are created by the following code?()  
Thing item, stuff;  
item = new Thing();  
Thing entity = new Thing();

A.One object is created
B.Two objects are created
C.Three objects are created
D.One reference variable is created
E.Two reference variables are created
F.Three reference variables are created.

5.单项选择题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

6.单项选择题An object is()

A.what classes are instantiated from.
B.an instance of a class.
C.a blueprint for creating concrete realization of abstractions.
D.a reference to an attribute.
E.a variable.

7.单项选择题A method is()

A.an implementation of an abstraction.
B.an attribute defining the property of a particular abstraction.
C.a category of objects.
D.an operation defining the behavior for a particular abstraction.
E.a blueprint for making operations.

9.多项选择题

public class MethodOver { 
private int x, y; 
private float z; 
public void setVar(int a, int b, float c){ 
x = a; 
y = b; 
z = c; 
} 
}  
Which two overload the setVar method?()   

A.  void setVar (int a, int b, float c){ x = a; y = b; z = c; }
B. public void setVar(int a, float c, int b) { setVar(a, b, c); }
C. public void setVar(int a, float c, int b) { this(a, b, c); }
D. public void setVar(int a, float b){ x = a; z = b; }
E. public void setVar(int ax, int by, float cz) { x = ax; y = by; z = cz; }