# CSA Unit 4 Lesson 6 Extra Practice

**URL:** <https://forum.code.org/t/csa-unit-4-lesson-6-extra-practice/38702>\
**Category:** CSA\
**Tags:** csa-unit-4\
**Created:** [November 20, 2023, 4:57pm UTC](https://forum.code.org/t/csa-unit-4-lesson-6-extra-practice/38702 "2023-11-20T16:57:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhu.xiaobo](https://avatars.discourse-cdn.com/v4/letter/z/919ad9/32.png) [@zhu.xiaobo](https://forum.code.org/u/zhu.xiaobo)\
**Post date:** [November 20, 2023, 4:57pm UTC](https://forum.code.org/t/csa-unit-4-lesson-6-extra-practice/38702/1 "2023-11-20T16:57:35Z")

</div>

For U4 Lesson 6 Extra Practice, could somebody help me understand why C is the correct answer? C. crayon.equals(sharpie)

The equals() method in Marker class only defined what returns false, and it doesn’t have any command to return true based on the color instance variable of a Marker object.

In addition, E seems to be incorrect due to the “==”. Changing the “==” to .equals() would make E correct. - Is my understanding correct?

---

<div class="post-metadata">

**Author:** ![sheck](https://avatars.discourse-cdn.com/v4/letter/s/a88e57/32.png) [@sheck](https://forum.code.org/u/sheck)\
**Post date:** [November 20, 2023, 5:44pm UTC](https://forum.code.org/t/csa-unit-4-lesson-6-extra-practice/38702/2 "2023-11-20T17:44:35Z")

</div>

```auto
 return (temp.getColor().equals(this.color));

```

will return True if the color Strings of the two objects are equal.

If the color Strings are equal, the Marker objects are considered equal.

```auto
public boolean equals(Object other) {
    if (other == null) {
      return false;
    }

    Marker temp = (Marker) other;
    // If the color Strings are equal, the Marker objects are equal
    return (temp.getColor().equals(this.color)); 
    }

```

---

<div class="post-metadata">

**Author:** ![zhu.xiaobo](https://avatars.discourse-cdn.com/v4/letter/z/919ad9/32.png) [@zhu.xiaobo](https://forum.code.org/u/zhu.xiaobo)\
**Post date:** [November 20, 2023, 10:19pm UTC](https://forum.code.org/t/csa-unit-4-lesson-6-extra-practice/38702/3 "2023-11-20T22:19:33Z")

</div>

Got it. Thank you so much Sheck!

---

<div class="post-metadata">

**Author:** ![sylvia.wood](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/sylvia.wood/32/5622_2.png) [@sylvia.wood](https://forum.code.org/u/sylvia.wood)\
**Post date:** [November 26, 2023, 11:21pm UTC](https://forum.code.org/t/csa-unit-4-lesson-6-extra-practice/38702/4 "2023-11-26T23:21:05Z")

</div>

@sheck - Kevin, thank you for addressing this post. Your response included a great explanation.  
@zhu.xiaobo - Zhu, thank you for posting your question. There may be others with the same interpretation of this question, so this may help them explain this answer to their students.

Sylvia
