多项选择题

Given the following interface definition, which definitions are valid?()  
interface I {  
void setValue(int val);  
int getValue(); 
 }   
DEFINITION a:  
(a) class a extends I {  int value;  
void setValue(int val) { value = val; 
}  
int getValue() { 
return value;
 }  
}  
DEFINITION b:  
(b) interface b extends I {  
void increment(); 
 }  
DEFINITION c:  
(c) abstract class c implements I {  
int getValue() {
 return 0; 
}  abstract void increment();  
}  
DEFINITION d:  
(d) interface d implements I {  void increment();  }  
DEFINITION e:  
(e) class e implements I {  int value;  
public void setValue(int val) { value = val; }  }  

A.Definition a.
B.Definition b.
C.Definition c.
D.Definition d.
E.Definition e.


您可能感兴趣的试卷

你可能感兴趣的试题

2.多项选择题Which are valid identifiers?()  

A._class
B.$value$
C.zer@
D.¥ngstr
E.2muchuq

3.单项选择题

Which method implementations will write the given string to a file named "file", using UTF8 encoding?()  
IMPLEMENTATION a: 
 public void write(String msg) throws IOException {  
FileWriter fw = new FileWriter(new File("file"));  
fw.write(msg);  
fw.close();  
}  
IMPLEMENTATION b: 
 public void write(String msg) throws IOException { 
 OutputStreamWriter osw =  new OutputStreamWriter(new FileOutputStream("file"), "UTF8");  osw.write(msg);  
osw.close();  
}  
IMPLEMENTATION c:  
public void write(String msg) throws IOException {  FileWriter fw = new FileWriter(new File("file"));  
fw.setEncoding("UTF8");  
fw.write(msg);  
fw.close();  }  
IMPLEMENTATION d:  
public void write(String msg) throws IOException {  FilterWriter fw = FilterWriter(new FileWriter("file"), "UTF8");  
fw.write(msg);  fw.close();  
}  
IMPLEMENTATION e:  
public void write(String msg) throws IOException {  
OutputStreamWriter osw = new OutputStreamWriter(  new OutputStream(new File("file")), "UTF8"  );  
osw.write(msg);  
osw.close();  
}  

A.Implementation a.
B.Implementation b.
C.Implementation c.
D.Implementation d.
E.Implementation e.

5.单项选择题Which statements concerning the effect of the statement gfx.drawRect(5, 5, 10, 10) are true, given that gfx is a reference to a valid Graphics object?()  

A.The rectangle drawn will have a total width of 5 pixels.
B.The rectangle drawn will have a total height of 6 pixels.
C.The rectangle drawn will have a total width of 10 pixels.
D.The rectangle drawn will have a total height of 11 pixels.

9.多项选择题Which of these statements concerning the collection interfaces are true?()  

A.Set extends Collection.
B.All methods defined in Set are also defined in Collection.
C.List extends Collection.
D.All methods defined in List are also defined in Collection.
E.Map extends Collection.