CMSC 335 CMSC335 Homework 2 Answer (UMUC)

CMSC 335 CMSC335 Homework 2 Answer (UMUC)

soffix

  • $14.99


CMSC 335 Homework 2 Answer / Object-Oriented and Concurrent Programming

1. (10 pts) What are the diagrams defined in the UML Standard. Give a one or two sentence description of each one. 

2. (10 pts) Given the following code, how should the toString methods in the classes H2ClassA and H2ClassB be written to give the indicated output and take advantage of the natural toString method in H2ClassB?

3. (10 pts) How can the following code be corrected? Give at least two good answers.

4. (10 pts) Why does the following code give a compiler error? How should it be fixed?

5. (10 pts) What is wrong with the following declaration? How should it be fixed?

6. (10 pts) What is wrong with the following code? How should it be fixed?

7. (10 pts) What is wrong with the following code? How should it be fixed?

8. (10 pts) What is wrong with the following code? x should be given a value of 24. What are two ways this can be legally accomplished?

9. (10 pts) What is wrong with the following code? Give two effective ways to fix it.

10. (10 pts) Why does the following code give a compiler warning? (Use javac -Xlint) How should it be fixed?


We Also Recommend


Sale

Unavailable

Sold Out