Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java Generics Activity

Step 1: Research

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 T or Type, that represent a data type in a generic class or method.
  • Boxing: Converting a primitive value like int into its wrapper class equivalent like Integer.
  • Unboxing: Converting a wrapper object like Integer back into a primitive value like int.
  • Autoboxing: Automatic boxing performed by Java, such as turning 27 into an Integer when needed.
  • Wrapper: An object type that wraps a primitive value, such as Integer, Double, Character, or Boolean.
  • Diamond Operator: The <> syntax used when creating generic objects so Java can infer the type arguments, such as new ArrayList<>().

Step 2: Read

Read the code examples provided for you in Read.java and Holder.java and perform the following steps on each problem:

  1. Write comments stating what each line of code is doing.
  2. Determine what the output of the code is.
  3. Summarize the purpose of the code based on what it does and what it produces.

Step 3: Write

Implement solutions for each problem in Write.java.

Step 4: Fix

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:

  1. Comment what the bug is and how you found it. If it is a syntax issue, copy the error message the IDE is providing.
  2. Correct the bug.

Step 5: Create

Design and implement solutions for the problems in Create.java.

Step 6: Review

Complete the peer review step with a classmate or friend outside of this repository.

Submission

Push your changes to your GitHub repo.

About

Completed Java Generics assignment

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages