CMSC 132A Lecture Notes - Lecture 39: Unordered Pair
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;
}
}