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 6374499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:29:46+00:00 2026-05-25T01:29:46+00:00

Can anyone tell me if this code: public class OvTester { @Override public int

  • 0

Can anyone tell me if this code:

public class OvTester {
    @Override
    public int hashCode() {
        return toString().hashCode();
    }
}

determines that the toString method in the OvTester class overrides the toString method in its superclass.

I’d like to know if this is true, and if so how it works?

If it’s not true, then is this true:

“the hashCode() method in OvTester must override the same name method in its superclass”

?

If that’s not correct then what is correct?

  • 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-25T01:29:46+00:00Added an answer on May 25, 2026 at 1:29 am

    Method overriding happens when you redefine a method with the same signature in a sublcass.

    So here you are overriding hashCode(), not toString()

    The @Override annotation is optional (but a very good thing) and indicates that this is expected to be overriding. If you misspell something or have a wrongly-typed parameter, the compiler will warn you.

    So yes, the 2nd statement is true (and the superclass in this case is java.lang.Object)

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

Sidebar

Related Questions

Can anyone tell me what is wrong with this code? public abstract class BoardTestBean{
Can anyone tell me what's wrong with this code? class Dataset < ActiveRecord::Base has_many
Can anyone tell what is wrong with this piece of code? template<class X> class
Can anyone tell me why this code would not be working? $('body').on('test', function() {
can anyone tell me why this code don't work: $q = $_GET['q']; // Load
Can anyone tell me what's wrong with this code? It's giving me an error
I stumbled across this C code today. Can anyone tell me what the 'where'
Hi can anyone tell me why VS2010 gives me an error with this code,
can anyone tell us what's wrong with this code below? we have here an
Can anyone tell me whats wrong in this code? when i try this i

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.