CMSI 281 Preparation for Quiz 1 ============================================================================== So far we've worked on a lot of concepts that great Java software developers need to know. Review the following (note that the topics are listing in no particular order): - The four exception classes you will probably throw quite a bit in your own code: IllegalArgumentException, IllegalStateException, NoSuchElementExcpetion, UnsupportedOperationException - Immutability - Static factory methods - Making a constructor private so construction may ONLY take place via factory methods - Enums - Interfaces - Subclassing - Deciding which methods should be abstract and which should not - Testing with JUnit (both positive and negative tests; tests that expect exceptions; how to look for boundary conditions: null, empty, full, etc.) - Constructors with this() calls - Being super vigilant about nulls -- prevent null arguments in constructors, prevent null fields, prevent method calls or field accesses on nulls. - Writing equals and hashCode and toString - Managing code in multiple packages - Class invariants, e.g. keeping the fields of objects in a consistent, known state (remember the direction value in the Line class, and the numerator and denominator in the Rational class). - Static initializers, instance initializers, anonymous classes We also did some UML. The quiz problems will mostly be ones in which you are asked to write a Java code fragment, but there will be at least one in which you have to give an UML diagram. There will definitely be questions in which you will have to - write a subclass of an existing subclass - write a Java method for processing an array given an English description of what the method is supposed to do - give an interface for something. To practice, try to write an interface for a robotic arm that controls an adjustible wrench. as well as a few others. Don't forget to check the practice questions linked from the class web page.