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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:10:48+00:00 2026-06-13T06:10:48+00:00

I am using Eclipse Build id: 20120614-1722. I have an object class called TOY1

  • 0

I am using Eclipse Build id: 20120614-1722.

I have an object class called “TOY1” and a function toString() within it. I previously know that when I call the

System.out.println(TOY1); 

It should return the address. However, and for some reason it is returning the toString() declared for my object without me specifying the @Override notation.

Is it safe to keep it that way? Or is this a new feature implemented in the specific build I have.

Thanks

EDIT

As asked this is part of my code:

public class TOY1 {

//irrelevant declarations

public String toString() {
String data;
data="Manufacturer=";
data+=manufact;
data+="DOP:";
data+=date_of_production;
return data;
}
}

When declaring TOY1_instance of TOY1 and then printing out using the System.out.printIn(TOY1_instance)

I am getting the actual data as opposed to some junk address.

My question is where did I override it no warning was shown and no extension overrides this class.

  • 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-06-13T06:10:49+00:00Added an answer on June 13, 2026 at 6:10 am

    System.out.println(obj); is calling obj.toString() internally. It happens that the default implementation of toString(), if you don’t override it, returns some address-like value.

    You can omit @Override annotation, but it’s safer to use it. It becomes especially useful when you think you are overriding while you aren’t because of tiny difference in signature. E.g.:

    @Override
    public String tostring() //...
    

    won’t compile. Even more common mistake is wrong equals():

    @Override
    public boolean equals(TOY1 obj) //...
    

    Do you see why? Without @Override it’s very easy to miss such a tremendous bug.

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

Sidebar

Related Questions

I am using Eclipse 3.4.1 Build M20080911-1700 I have tried to change the classpath
I want to build a JNI DLL using Eclipse and Cygwin. I know there
I have a maven web app build using Eclipse, and have this command: install
I'm trying to build a runnable JAR using Eclipse's Export function. everything works fine
I am using eclipse to build the EAR of my project. So I have
I build a class diagram using Eclipse modeling tool-Papyrus. how can i export UML
I use eclipse sometimes to build my android project(Using ADT 19). If i have
I'm using eclipse to build an android app which is tracked in TFS. There's
currently, I am developing web-apps using Eclipse. The build is done using Maven. The
As an experiment we want to build our products using the Eclipse java compiler

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.