Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3236466
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:37:31+00:00 2026-05-17T17:37:31+00:00

The instructions say: Create an equals method that takes an object reference and returns

  • 0

The instructions say:
Create an equals method that takes an object reference and returns true if the given object equals this object.
* Hint: You’ll need ‘instanceof’ and cast to a (Position)

I have:

class Position {

    private double x,y;
    private int id;

public boolean instanceOf(Object a)
    {
        boolean isInstance;
        if ((Position)a instanceof Position)
            isInstance=true;
        else
            isInstance=false;
        return isInstance;
    }

But I’m doing it wrong, and I dont know what my problem is. I’m new to objects so this is kind of confusing me..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T17:37:32+00:00Added an answer on May 17, 2026 at 5:37 pm

    As this is a homework question, I won’t give a detail answer.
    You have to implement a equals() method, not a instanceOf() method. I think this link help:

    • http://www.ibiblio.org/java/course/week4/37.html
    • http://www.billthelizard.blogspot.com/2008/08/implementing-equals-in-java.html

    The code example in them should be sufficient. Ask again if you need more hint.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to understand this piece better because when I reached that step in
OK, say that my application is emitting (x86) instructions into memory, making the page
I am trying to create a custom 404 error page. The instructions that I
Lets say we have an average of one page fault every 20,000,000 instructions, a
I followed the instructions given in the link: http://blog.avirtualhome.com/how-to-compile-a-new-ubuntu-11-04-natty-kernel/ for building a custom kernel
Following Ryan Bates' instructions on creating a before_filter that sets a time_zone like so
I am trying to create an md5 value in php using the instruction given.
I have a text file with commands to, say, create a table. How do
I just downloaded a Vim plugin for Sass syntax highlight. The instructions say: install
Let's say you want to construct an Iterator that spits out File objects. What

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.