多项选择题Which modifiers and return types would be valid in the declaration of a working main() method for a Java standalone application?()  

A.private
B.final
C.static
D.int
E.abstract


您可能感兴趣的试卷

你可能感兴趣的试题

1.单项选择题Which statements concerning the switch construct are true?()  

A.All switch statements must have a default label.
B.There must be exactly one label for each code segment in a switch statement.
C.The keyword continue can never occur within the body of a switch statement.
D.No case label may follow a default label within a single switch statement.
E.A character literal can be used as a value for a case label.

3.多项选择题Which statements concerning the correlation between the inner and outer instances of non-static inner classes are true?()  

A.Member variables of the outer instance are always accessible to inner instances, regardless of their      accessibility modifiers.
B.Member variables of the outer instance can never be referred to using only the variable name within     the inner instance.
C.More than one inner instance can be associated with the same outer instance.
D.All variables from the outer instance that should be accessible in the inner instance must be declared     final.
E.A class that is declared final cannot have any inner classes.

4.多项选择题Which statements concerning the methods notify() and notifyAll() are true?  

A.Instances of class Thread have a method called notify().
B.A call to the method notify() will wake the thread that currently owns the monitor of the object.
C.The method notify() is synchronized.
D.The method notifyAll() is defined in class Thread.
E.When there is more than one thread waiting to obtain the monitor of an object, there is no way to be     sure which thread will be notified by the notify() method.

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

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

8.单项选择题

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.

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