Here are concise definitions for the required terms:
- Generics: A Java feature that lets you write classes, interfaces, and methods that work with different data types while still checking types at compile time.
- Type Parameters: Placeholder type names, such as
TorType, that represent a data type in a generic class or method. - Boxing: Converting a primitive value like
intinto its wrapper class equivalent likeInteger. - Unboxing: Converting a wrapper object like
Integerback into a primitive value likeint. - Autoboxing: Automatic boxing performed by Java, such as turning
27into anIntegerwhen needed. - Wrapper: An object type that wraps a primitive value, such as
Integer,Double,Character, orBoolean. - Diamond Operator: The
<>syntax used when creating generic objects so Java can infer the type arguments, such asnew ArrayList<>().
Read the code examples provided for you in Read.java and Holder.java and perform the following steps on each problem:
- Write comments stating what each line of code is doing.
- Determine what the output of the code is.
- Summarize the purpose of the code based on what it does and what it produces.
Implement solutions for each problem in Write.java.
Read the code in Fix.java. Each problem has one or more bugs that you will need to fix. For each bug you find, perform the following actions:
- Comment what the bug is and how you found it. If it is a syntax issue, copy the error message the IDE is providing.
- Correct the bug.
Design and implement solutions for the problems in Create.java.
Complete the peer review step with a classmate or friend outside of this repository.
Push your changes to your GitHub repo.