CMSC 132A Lecture Notes - Lecture 39: Unordered Pair

99 views4 pages
CMSC132A Lecture 39: Midterm 2 Review
Problem 1:
The designers of Java have decided that Java 38 which will be released in 2026, is
going to remove Boolean values from the language. Here is a potential substitute:
Interface Bool {
Bool or(Bool b);
Bool and(Bool b);
Bool not();
Bool same(Bool b);
}
Design two classes true and false that implements the Bool interface.
Problem 2:
Class JStr implements Json {
String a;
JString(String a);
}
Class JInt implements Json {
Integer i;
JInt(Integer i) {
this.i=i;
}
}
Unlock document

This preview shows page 1 of the document.
Unlock all 4 pages and 3 million more documents.

Already have an account? Log in

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents