多项选择题

Which code fragments will succeed in initializing a two-dimensional array named tab with a size that will cause the expression tab[3][2] to access a valid element?()  
CODE FRAGMENT a:  int[][] tab = {  { 0, 0, 0 },  { 0, 0, 0 }  };  
CODE FRAGMENT b:  int tab[][] = new int[4][];  for (int i=0; i  
CODE FRAGMENT c:  int tab[][] = {  0, 0, 0, 0,  0, 0, 0, 0,  0, 0, 0, 0,  0, 0, 0, 0  };  
CODE FRAGMENT d:  int tab[3][2];  
CODE FRAGMENT e:  int[] tab[] = { {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0} };  

A.Code fragment a.
B.Code fragment b.
C.Code fragment c.
D.Code fragment d.
E.Code fragment e.


您可能感兴趣的试卷

你可能感兴趣的试题

1.单项选择题It is desirable that a certain method within a certain class can only be accessed by classes that are defined within the same package as the class of the method. How can such restrictions be enforced?()  

A.Mark the method with the keyword public.
B.Mark the method with the keyword protected.
C.Mark the method with the keyword private.
D.Mark the method with the keyword package.
E.Do not mark the method with any accessibility modifiers.

2.多项选择题Which of these are keywords in Java?()  

A.default
B.NULL
C.String
D.throws
E.long

4.单项选择题Which methods from the String and StringBuffer classes modify the object on which they are called?()  

A.The charAt() method of the String class.
B.The toUpperCase() method of the String class.
C.The replace() method of the String class.
D.The reverse() method of the StringBuffer class.
E.The length() method of the StringBuffer class.

7.单项选择题How does the weighty property of the GridBagConstraints objects used in grid bag layout affect the layout of the components?()  

A.It affects which grid cell the components end up in.
B.It affects how the extra vertical space is distributed.
C.It affects the alignment of each component.
D.It affects whether the components completely fill their allotted display area vertically.

8.多项选择题

Which lines of code are valid declarations of a native method when occurring within the declaration of the following class?()   
public class Qf575 {  
// insert declaration of a native method here 
 }  

A.native public void setTemperature(int kelvin);
B.private native void setTemperature(int kelvin);
C.protected int native getTemperature();
D.public abstract native void setTemperature(int kelvin);
E.native int setTemperature(int kelvin) {}

10.单项选择题What does the value returned by the method getID() found in class java.awt.AWTEvent uniquely identify?()  

A.The particular event instance.
B.The source of the event.
C.The set of events that were triggered by the same action.
D.The type of event.
E.The type of component from which the event originated.