hw6 - Homework 6 CSC 7101, Spring 2011 Due: 4 May 2011 1....

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Homework 6 CSC 7101, Spring 2011 Due: 4 May 2011 1. An int in Java is represented as a 32-bit number, float and double are represented as 32-bit and 64-bit IEEE 754 floating point numbers, respectively. Suppose we define the subtype relationship on integers and floating point numbers as a subset relationship on the sets of numbers that can be represented in a given type. Is int a subtype of float ? Is it a subtype of double ? You can easily find the precise layout of IEEE floating points by searching for IEEE 754 on Google or other search engines. 2. Given the following Java code: class C { public int foo (C x) { return 0; } } class D extends C { public int foo (C x) { return 1; } public int foo (D x) { return 2; } } C p = new D(); C q = new D(); int i = p.foo(q); Which method is executed for the call p.foo(q) ? Explain why. 3. Explain in English what the ML type (a -> b -> c) -> (d -> e) -> (a * d) list -> ((b -> c) * e) list stands for....
View Full Document

Page1 / 2

hw6 - Homework 6 CSC 7101, Spring 2011 Due: 4 May 2011 1....

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online