多项选择题

public interface Foo{ 
int k = 4;  
}  
Which three are equivalent to line 2? ()

A. Final int k = 4;
B. Public int k = 4;
C. Static int k = 4;
D. Private int k = 4;
E. Abstract int k = 4;
F. Volatile int k = 4;
G. Transient int k = 4;
H. Protected int k = 4;


您可能感兴趣的试卷

你可能感兴趣的试题

1.单项选择题

int index = 1;  
String test = new String;  
String foo = test[index]; 
What is the result?()

A.  Foo has the value “”
B. Foo has the value null
C. An exception is thrown
D. The code will not compile

4.单项选择题Which is a valid identifier?() 

A. false
B. default
C. _object
D. a-class

5.单项选择题Which constructs a BufferedIputStream?()

A. New BufferedInputStream(“in.txt”);
B. New BufferedInputStream(new File(“in.txt”));
C. New BufferedInputStream(Writer(“in.txt”));
D. New BufferedInputStream(new Writer(“in.txt”));
E. New BufferedInputStream(new InputStream(“in.txt”));
F. New BufferedInputStream(new FileInputStream(“in.txt”));

6.多项选择题Which two construct an OutputSream that appends to the file “file.txt”? ()

A. OutputStream out=new FileOutputStream(“file.txt”);
B. OutputStream out=new FileOutputStream(“file.txt”, “append”);
C. FileOutputStream out=new FileOutputStream(“file.txt”, true);
D. FileOutputStream out=new FileOutputStream(new file(“file.txt”));
E. OutputStream out=new FileOutputStream(new File(“file.txt”)true);

7.多项选择题Which two create an InputStream and open file the “file.txt” for reading? ()

A. InputStream in=new FileReader(“file.txt”);
B. InputStream in=new FileInputStream(“file.txt”);
C. InputStream in=new InputStreamFileReader (“file.txt”, “read”);
D. FileInputStream in=new FileReader(new File(“file.txt”));
E. FileInputStream in=new FileInputStream(new File(“file.txt”));

8.单项选择题Which determines if “prefs” is a directory and exists on the file system?()  

A. Boolean exists=Directory.exists (“prefs”);
B. Boolean exists=(new File(“prefs”)).isDir();
C. Boolean exists=(new Directory(“prefs”)).exists();
D. Boolean exists=(new File(“prefs”)).isDirectory();
E. Boolean exists=true;  Try{  Directory d = new Directory(“prefs”);  } catch (FileNotFoundException e) {  exists = false;  }

10.多项选择题Which two statements are true regarding the creation of a default constructor? ()  

A. The default constructor initializes method variables.
B. The compiler always creates a default constructor for every class.
C. The default constructor invokes the no-parameter constructor of the superclass.
D. The default constructor initializes the instance variables declared in the class.
E. When a class has only constructors with parameters, the compiler does not create a default  constructor.