+ All Categories
Home > Documents > Cs2220: Engineering Software Class 13: Behavioral Subtyping Fall 2010 University of Virginia David...

Cs2220: Engineering Software Class 13: Behavioral Subtyping Fall 2010 University of Virginia David...

Date post: 18-Jan-2018
Category:
Upload: gerald-powers
View: 220 times
Download: 0 times
Share this document with a friend

If you can't read please download the document

Transcript

cs2220: Engineering Software Class 13: Behavioral Subtyping Fall 2010 University of Virginia David Evans Whats the difference between a black bear and a grizzly bear? Killer BlackBear GrizzlyBear Climber Bear KillingBear Exam 1 Question 1 Give one concrete example where the Java programming language designers sacrificed expressiveness for truthiness. An ideal answer would illustrate your example with code snippets showing something that is difficult to express concisely because of the Java languages emphasis on truthiness. public class HelloWorld { public static void main (String [] args) { System.out.println(Hello!); } What are the language design decisions Java made differently from Scheme to explain why this is so long? What Java language design decisions make this so long? public class HelloWorld { public static void main (String [] args) { System.out.println(Hello!); } Question 1 public class HelloWorld { public static void main (String [] args) { System.out.println(Hello!); } 1.Static typing: big win for truthiness 2.All procedures must be inside a class 3.Default visibility is not public (package protected) 4.Use squiggly brackets to denote blocks, semi-colons to end statements 5.Not providing a special, convenient way to print output, but requiring an I/O object and invoking a method Exam = PAPB


Recommended