Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Easy One?: Syntax to return hashtable from a method? 1

Status
Not open for further replies.
Jan 8, 2001
163
0
0
US
Hi. I'll apologize up front for this question as I'm sure it's a simple one. I'm extremely new to JSP, Java classes etc.

My question is how can I return a hashtable from a method? In all of the examples I've found, the class which establishes and fills the hashtable is declared public so all of the other methods can see the hashtable. I would prefer to pass the hashtable to the calling object. Does anyone know the syntax for this?

ie/ Return HashtableName[]?

Thanks in Advance,
CrystalVisualBOracle (-:
 
Do you mean like this? :


Hashtable myMethod(Object o)
{
Hashtable h = new Hashtable();
...
return h;
}
 
Yep Thank You MetalEye! That was even easier that I thought. I think I've been going around in circles so long that things appear harder than they really are. I'm glad tomorrow's Friday :)

Thanks Again,
CrystalVisualBOracle.
 

u'd better return Cleection instead of Hashtable. let the caller cast it if it wanna.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top