MATH 114 Midterm: MATH 114 UPenn 114Fall 10ans Exam
24 views17 pages
Document Summary
1: java concepts: true or false (10 points) All of the following questions pertain to java. a. If s and t are variables of type string such that s == t, then s. equals(t) is guaranteed to return true. b. The call m(new object()) may throw a nullpointerexception when m is declared with the type signature shown below: public void m(object o) c. The call m(new object()) may throw an ioexception when m is declared with the type signature shown below: public void m(object o) d. The keyword synchronized, when applied to a method, ensures that at most one thread at a time is executing in method"s body. e. F whenever you override the equals method of a class, you should be sure to override the hashcode method compatibly. f. The circle class below demonstrates how inheritance can be used to avoid code duplication: public class circle { Point center; public circle(int x, int y) { center = new point(x,y); g.
Get access
Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers