answer 51)
4) 10020
in the call
another(v,i);
a reference to v is passed and thus any changes will be intact after this call.
answer 52)
1) public void amethod(string s, int i){}
4) public void amethod(int i, string s) {}
overloaded methods are differentiated only on the number, type and order of parameters, not on the return type of the method or the names of the parameters.
answer 53)
4)base b = new base(10);
any call to this or super must be the first line in a constructor. as the method already has a call to this, no more can be inserted.
answer 54)
1) system.out.println(s);
4) system.out.println(iargs);
a class within a method can only see final variables of the enclosing method. however it the normal visibility rules apply for variables outside the enclosing method.
answer 55)
1) yield()
2) sleep
4) stop()
note, the methods stop and suspend have been deprecated with the java2 release, and you may get questions on the exam that expect you to know this. check out the java2 docs for an explanation
answer 56)
1) addelement
answer 57)
the import statement allows you to use a class directly instead of fully qualifying it with the full package name, adding more classess with the import statement does not cause a runtime performance overhad. i assure you this is true. an inner class can be defined with the protected modifier, though i am not certain why you would want to do it. an inner class can be defined with the private modifier, try compiling some sample code before emailing me to ask about this.
3)a inner class may under some circumstances be defined with the protected modifier
4) an interface cannot be instantiated
answer 58)
1) mousepressed(mouseevent e){}
4) componentadded(containerevent e){}
answer 59)
1) iterator
2) isempty
3) toarray
answer 60)
2) ensures only one thread at a time may access a method or object
责任编辑:小草