STAT 102 Midterm: STAT 102 UPenn Midterm2 Solutions.Fall 2001

26 views13 pages
31 Jan 2019
School
Department
Course
Professor

Document Summary

1: facts about ocaml and java (15 points) For each part, circle true or false. a. b. The . equals method in java is roughly similar to ocaml"s = operator. The == operator in both ocaml and java tests whether two compound values have identical structure. No: == is reference equality in both languages. c. In java, there is a class that is a subtype of any other class. No: the class hierarchy is tree structured. e. f. g. h. i. j. k. l. m. In java, an interface can extend zero, one, or several other interfaces. In java, a class can extend zero, one, or several other classes. In the java asm, large data structures such as object values are stored in the stack, not the heap. No: in both asms, large structures live in the heap. In the ocaml asm, bindings of variables to values in the stack are immutable, while in java they are mutable.