473,326 Members | 2,113 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,326 software developers and data experts.

address or pointer

what my actual problem is

i declared a Array of Strings as

String st[]={"a","b","c"}
System.out.println(st);

then i got the out put as
java.lang.String;@10b62c9

then why can't i get this kind of information for a collection object "set"
if i give like this Set set=new HashSet();
Oct 11 '07 #1
2 1273
JosAH
11,448 Expert 8TB
You can get that information but I wonder what use is has for you:

Expand|Select|Wrap|Line Numbers
  1. String info= set.getClass().getName() + '@' + Integer.toHexString(hashCode());
  2.  
That's the default String representation returned by Object's toString method. Note
that all the hexadecimal stuff at the end does *not* represent the 'address' of an
object; i.e. it's the hashCode of that object.

kind regards,

Jos
Oct 11 '07 #2
r035198x
13,262 8TB
what my actual problem is

i declared a Array of Strings as

String st[]={"a","b","c"}
System.out.println(st);

then i got the out put as
java.lang.String;@10b62c9

then why can't i get this kind of information for a collection object "set"
if i give like this Set set=new HashSet();
To see the array contents you can use
Expand|Select|Wrap|Line Numbers
  1. java.util.Arrays.toString(st);
Oct 11 '07 #3

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

Similar topics

12
by: johny smith | last post by:
I am trying to figure out a way to print the address of what called a certain function once inside the function. I am assuming that this information is on the stack somewhere. But can someone...
1
by: JuanPedro | last post by:
OS: Windows XP Home SP2 CPU/Ram: Mobile AMD Duron 4, 1GHz / 256MB System Manufacturer: Compaq Presario 730us Using windiag.exe to test my RAM I get a consistent error for the following address:...
35
by: hasho | last post by:
Why is "call by address" faster than "call by value"?
15
by: dandelion | last post by:
Hi, Just another question for the standards jockeys... Suppose I have an Interrupt Vector Table located at address 0x0000 (16-bit machine). I want to dump the context of the IVT, by treating...
33
by: baumann.Pan | last post by:
hi all, i want to get the address of buf, which defined as char buf = "abcde"; so can call strsep(address of buf, pointer to token);
16
by: jimjim | last post by:
#include <stdio.h> #include <stdlib.h> //WARNING: The function's signature should be: f( int ** ) void f(int *ip) { static int dummy = 5; *ip = &dummy; } int main(){
57
by: Robert Seacord | last post by:
i am trying to print the address of a function without getting a compiler warning (i am compiling with gcc with alot of flags). if i try this: printf("%p", f); i get: warning: format %p...
54
by: John | last post by:
Is the following program print the address of the function? void hello() { printf("hello\n"); } void main() { printf("hello function=%d\n", hello); }
36
by: Julienne Walker | last post by:
Ignoring implementation details and strictly following the C99 standard in terms of semantics, is there anything fundamentally flawed with describing the use of a (non-inline) function as an...
7
by: John Koleszar | last post by:
Hi all, I'm porting some code that provides compile-time assertions from one compiler to another and ran across what I believe to be compliant code that won't compile using the new compiler. Not...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.