Mark the method with the keyword public.
Mark the method with the keyword protected.
Mark the method with the keyword private.
Mark the method with the keyword package.
Do not mark the method with any accessibility modifiers.
第1题:
You develop a serializable class for persisting objects as files.Every time an object is serialized, you have to update the database with the name of the object and location of that file.You elect to employ the OnSerialized attribute to achieve this objective.You now need to apply the OnSerialized attribute to a certain method.What should you do?()
A.
B.
C.
D.
第2题:
A.4
B.5
C.8
D.9
E.Compilation fails.
F.An exception is thrown at runtime.
G.It is impossible to determine for certain.
第3题:
第4题:
第5题:
1. public class a { 2. public void method1() { 3. try { 4. B b=new b(); 5. b.method2(); 6. // more code here 7. } catch (TestException te) { 8. throw new RuntimeException(te); 9. } 10. } 11. } 1. public class b { 2. public void method2() throws TestException { 3. // more code here 4. } 5. } 1. public class TestException extends Exception { 2. } Given: 31. public void method() { 32. A a=new a(); 33. a.method1(); 34. } Which is true if a TestException is thrown on line 3 of class b?()
第6题:
Which methods from the String and StringBuffer classes modify the object on which they are called?()
第7题:
advanced
retarded
relayed
cut off
第8题:
native public void setTemperature(int kelvin);
private native void setTemperature(int kelvin);
protected int native getTemperature();
public abstract native void setTemperature(int kelvin);
native int setTemperature(int kelvin) {}
第9题:
A final method in class X can be abstract if and only if X is abstract.
A protected method in class X can be overridden by any subclass of X.
A private static method can be called only within other static methods in class X.
A non-static public final method in class X can be overridden in any subclass of X.
A public static method in class X can be called by a subclass of X without explicitly referencing the class X.
A method with the same signature as a private final method in class X can be implemented in a subclass of X.
A protected method in class X can be overridden by a subclass of X only if the subclass is in the same package as X.
第10题:
The charAt() method of the String class.
The toUpperCase() method of the String class.
The replace() method of the String class.
The reverse() method of the StringBuffer class.
The length() method of the StringBuffer class.
第11题:
the tanker is within 50 nautical miles from the nearest land
the tanker is no more than 50 nautical miles from the nearest land
the tanker is more than 50 nautical miles from the nearest land
the tanker is not more than 50 nautical miles from the nearest land
第12题:
Line 33 must be called within a try block.
The exception thrown by method1 in class a is not required to be caught.
The method declared on line 31 must be declared to throw a RuntimeException.
On line 5 of class a, the call to method2 of class b does not need to be placed in a try/catch block.
第13题:
A.Line 33 must be called within a try block.
B.The exception thrown by method1 in class A is not required to be caught.
C.The method declared on line 31 must be declared to throw a RuntimeException.
D.On line 5 of class A, the call to method2 of class B does not need to be placed in a try/catch block.
第14题:
An oil tanker,except as provided for otherwise,might discharge certain amount at certain rate of oil or oily mixtures into sea when ______.
A.she is not within a special area
B.she is within a special area
C.she has just departured from a special area
D.she is about to enter a special area
第15题:
第16题:
Which two statements are true about the hashCode method?()
第17题:
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?()
第18题:
You are implementing a Windows Communication Foundation (WCF) client application that consumes the ICatalog and lCatalog2 service interfaces.You need to ensure that the client discovers services implementing these interfaces. The services may already be online or may come online within a 30 second time limit. How should you use WCF Discovery to accomplish this?()
第19题:
taken
gone
gotten
made
第20题:
Mark the method with the keyword public.
Mark the method with the keyword protected.
Mark the method with the keyword private.
Mark the method with the keyword package.
Do not mark the method with any accessibility modifiers.
第21题:
he sometimes wants to confuse the buyers
he knows from experience that certain people will want to buy certain items
he wants to keep certain people waiting
he wants to reduce the number of buyers
第22题:
she is not within a special area
she is within a special area
she has just departured from a special area
she is about to enter a special area
第23题:
improves
installs
contains
requests
第24题:
The hashCode method for a given class can be used to test for object equality and object inequality for that class.
The hashCode method is used by the java.util.SortedSet collection class to order theelements within that set.
The hashCode method for a given class can be used to test for object inequality, but NOT object equality, for that class.
The only important characteristic of the values returned by a hashCode method is that the distribution of values must follow a Gaussian distribution.
The hashCode method is used by the java.util.HashSet collection class to group the elements within that set into hash buckets for swift retrieval.