Put your answers into lab13/report.txt
. Turn in your diagrams as PNG files or photos.
ch02/mail
, exactly which line of code corresponds to Figure 2-11? x.f(y)
, and x
is of type C
and y
of type P
. Draw a sequence diagram with as much information as you can. Which parts can you not fill in? Why? Which part of the information can't you use? Why? The book points out one of the limitations. Which? x = new A(y);where again
x
is of type C
and y
is of type P. Draw a sequence diagram with as much information as you can. What is different about this diagram? Where in the book was that difference mentioned?Comparator
...”Collections.sort(countries, comp);Use the convention that a static method is invoked on the class object
Collections.class
. (BTW, the book does not say that anywhere.) Use your general knowledge of sorting to figure out what sort
does, and how you can express that with one or more additional arrows. (What about the loops inside sort
? See section 2.9.)IntSeqTest.java
. Start with three objects: the unit test object, seq1
, and seq2
. What are their types? For an anonymous class that implements an interface, use ? implements InterfaceName
. ? implements ...
?seq1.alternate(seq2);Now look at Section 2.9 and carefully check whether you did it right. How can you tell?
alternate
method. What kind of arrow do you need to draw what it does?IntSeqTest.java
. We don't really care about the call to assertEquals
since we aren't trying to learn how JUnit works. What call do we care about? Draw one arrow for that call.next
method?alternate
does it answer?