Can an inner class declared inside of a method access local variables of this method?
A. It’s possible if these variables are final. Q17. What can go wrong if you replace && with & in the following code: String a=null; if (a!=null && a.length()>10) {…} A. A single ampersand here would lead to a NullPointerException. Q18. What’s the main difference between a Vector and an ArrayList A. Java Vector class is internally synchronized and ArrayList is not.
A. It’s possible if these variables are final. 49. What can go wrong if you replace && with & in the following code: String a=null; if (a!=null && a.length()>10) {…} A. A single ampersand here would lead to a NullPointerException. 50. What’s the main difference between a Vector and an ArrayList A. Java Vector class is internally synchronized and ArrayList is not.