473,769 Members | 2,372 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Printing a java object value

19 New Member
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@1234 5. But I want to display the exact value that it contains. Does anybody know how to do this?

Thanks
Mar 26 '09 #1
6 4368
r035198x
13,262 MVP
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 New Member
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 MVP
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 New Member
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 MVP
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 New Member
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
1498
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 working at all. My strategy is first to save the form's image as a bitmap (this works, I can save the image to a file). Then I use the printer's Graphics object's drawImage method to send it
4
6478
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. When they log to application (through web browser) and choose the print option, on the right margin few cm get cut off (so some fields do not print out). Is there any function that ensure that when user pritns he gets the
2
6966
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 attending interviews. If you own a company best way to judge if the candidate is worth of it. http://www.questpond.com/InterviewRatingSheet.zip
4
1903
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 the paper below the three lines because I am using those fiscal printers... down below is the, modified, code I found in internet... i am trying to do that in about 4 hours without any good result.
8
5912
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 clients (Internet Explorer). My flash content was originally brought in via the “flash satay” method, but I have since used some server-side magic do deliver one <objecttag
3
2105
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 compiled and I finally got my Inventory class compiled but when I run the program it prints the first line correctly then I input the item name but then it prints the next two lines when it should print one and allow me to input then print the next. ...
5
1802
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
6290
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 JDK 6 downloadable from http://java.sun.com/javase/downloads/index.jsp. I will be using JDK 5(update 8)
0
2851
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 printing printing data and the actual database data in a recordset. the class looks like this: Public Class BRPDD 'Balance Report PrintingDocument Data Public totalReceiptsNum As Integer Public totalLicFee As Double
0
9416
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10035
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9981
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8862
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 projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7396
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 presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5293
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5436
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3948
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2810
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.