LaunchCodeEducation / LaunchCodeEducation/csharp-web-dev-curriculum

Chapter 5 Special Methods code example method uses wrong return type

Open Beginner friendly
#67 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
1
Forks
5
PR merge metrics
No merged PRs in 30d

Description

Relevant link

Text code shows:

public override boolean Equals(object toBeCompared) {

   if (toBeCompared.GetType() != this.GetType())
   {
      return false;
   }

   Student s = toBeCompared as Student;
   return s.StudentId == StudentId;
}

C# return type should be bool and not boolean

Suggested change:

public override bool Equals(object toBeCompared) {

   if (toBeCompared.GetType() != this.GetType())
   {
      return false;
   }

   Student s = toBeCompared as Student;
   return s.StudentId == StudentId;
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open the linked Chapter 5 Special Methods page and locate the “Coding a New Equals Method” example. Update the displayed C# return type from boolean to bool, then verify the rendered code example shows the correct type.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.