On Feb 22, 10:05 am, abhishek shukla <[email protected]> wrote:
> hi,
> I am having some problem with java collection homework exercise.
> I am having problem in displaying the correct output of the MyOwnClass
> object which
> is added to the hash set .When I am trying to display its output I am
> getting the reference of MyOwnClass object instead of the values of its data
> members name and age
>
>  I am getting the reference of MyOwnClass objects
> as output  like
>
> *myowncl...@82ba41
> myowncl...@10b62c9*
See the javadoc for Object class, there is a method which you could
override to change the output. (Hint: the javadoc explains exactly
what you see, so it should be easy to find which method it is, then
you override it quite simply with the value you want.
You may also look at the javabeans exercise 3.4 output, which has also
this method listed.
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to