# 1.4. Quiz

## Coding

* Create a class called [`LongIntegerQuiz`](https://github.com/emory-courses/dsa-java/blob/master/src/main/java/edu/emory/cs/algebraic/LongIntegerQuiz.java) under the main [`algebraic`](https://github.com/emory-courses/dsa-java/tree/master/src/main/java/edu/emory/cs/algebraic) package that extends the [`LongInteger`](https://github.com/emory-courses/dsa-java/blob/master/src/main/java/edu/emory/cs/algebraic/LongInteger.java) class.
* Override the [`addDifferentSign()`](https://github.com/emory-courses/dsa-java/blob/master/src/main/java/edu/emory/cs/algebraic/LongIntegerQuiz.java#L19) method so that the `add()` method in [`LongIntegerQuiz`](https://github.com/emory-courses/dsa-java/blob/master/src/main/java/edu/emory/cs/algebraic/LongIntegerQuiz.java) can handle integers with different signs.

## Testing

* Create the [`LongIntegerQuizTest`](https://github.com/emory-courses/dsa-java/blob/master/src/test/java/edu/emory/cs/algebraic/LongIntegerQuizTest.java) class under the test [`algebraic`](https://github.com/emory-courses/dsa-java/tree/master/src/test/java/edu/emory/cs/algebraic) package.
* Test the correctness of your `LongIntegerQuiz` using the unit tests.
* Add more tests for a more thorough assessment if necessary.

## Quizzes

1. What is the advantage of using *Generics*?
2. How do you make the class you define *comparable*?
3. What is the advantage of overriding member methods in the *Object* class?
4. What kind of methods should be defined as *static*?

## Submission

1\. Commit and push everything under the following packages to your GitHub repository:

* Main: [src/main/java/edu/emory/cs/algebraic](https://github.com/emory-courses/dsa-java/tree/master/src/main/java/edu/emory/cs/algebraic)
* Test: [src/test/java/edu/emory/cs/algebraic](https://github.com/emory-courses/dsa-java/tree/master/src/test/java/edu/emory/cs/algebraic)

2\. Submit answers to the above [quizzes](#quizzes) to Canvas.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://emory.gitbook.io/dsa-java/java-essentials/exercises.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
