473,396 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Printing a java object value

19
Hi all,

I have created a java object that contains some xml tags. When I print it using obj.toString(), it displays some hashed value something like objecttype@12345. But I want to display the exact value that it contains. Does anybody know how to do this?

Thanks
Mar 26 '09 #1
6 4348
r035198x
13,262 8TB
Override the toString method in your class to display what you want.
The default behavior of toString inherited from mother Object simply outputs the class name @ the hexadecimal value of the hash code.
Mar 26 '09 #2
gjain12
19
Actually, the thing is that using APIs I have created this object and I am not sure whether it has been created correct or not. Thats why I wanted to print it.

This should create some xml. Do you have any idea how can I know whether the format of my xml is correct or not?
Mar 26 '09 #3
r035198x
13,262 8TB
Since you are not getting null then it means that the object was certainly created.
How to find out what's in it e.t.c depends on the methods available for that object. What class type is it? Do you have the API docs for that class?
Mar 26 '09 #4
gjain12
19
Actually this makes use of custom APIs that has been developed by third party and I don't have the API docs but I know that whatever attribute I have set using set methods have corresponding get methods also.

Actually my concern is to see the complete XML with tags creted by those methods.
Mar 26 '09 #5
r035198x
13,262 8TB
Perhaps I'm not getting what you are asking but why not just call the methods that return the XML (if there are any) to see what the XML is.
P.S Using any third party package that is not well documented and doesn't have API docs is a complete waste of time. How would you know what a method does when you call it?
Mar 26 '09 #6
gjain12
19
ok..thanks I think I have to get back to them and ask for docs.
Mar 26 '09 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: JF Turcotte | last post by:
Hi I'm unsuccessfully trying to print a form's image under VB.NET. To print under .NET is a real pain in the , I find it to be complex, lenghty, confusing, upsetting and ultimately not to be...
4
by: Suzanka | last post by:
Hello, I have an application written in C# on visual studio .NET. It is a web aplication. The application consists of many different forms, that users occassionaly want to print out for filing....
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
4
by: jodi | last post by:
Hi, I am really newbie in Java I need to build an applet that prints a text, but, it can not roll the page I mean, when I print like "TEST ONE TEST TWOO TEST THREEE" the printer can not roll...
8
by: Neo Geshel | last post by:
Greetings. BACKGROUND: My sites are pure XHTML 1.1 with CSS 2.1 for markup. My pages are delivered as application/xhtml+xml for all non-MS web clients, and as text/xml for all MS web...
3
trkrbabe
by: trkrbabe | last post by:
Hi, this is my first time posting here. It appears that I am taking the same class as a few other people here. I have only been learning Java for about five weeks now. I have my Product class...
5
by: Jromero | last post by:
I have a problem with printing the array Here is the print out Picture a vehicle number 1 : What's it's max speed?
5
by: r035198x | last post by:
Setting up. Getting started To get started with java, one must download and install a version of Sun's JDK (Java Development Kit). The newest release at the time of writting this article is...
0
it0ny
by: it0ny | last post by:
Hi guys, thanks I am fairly new to this forum so I hope I chose the right place to post this question. I try to make my program printout a deposit's report. I created a class to store the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.