aspose file tools*
The moose likes Java in General and the fly likes com.javaranch.common - CastMap.getString(...) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "com.javaranch.common - CastMap.getString(...)" Watch "com.javaranch.common - CastMap.getString(...)" New topic
Author

com.javaranch.common - CastMap.getString(...)

Donald R. Cossitt
buckaroo
Ranch Hand

Joined: Jan 31, 2003
Posts: 401

How does get( key ) work when no HashTable has been populated or even declared?


doco
John Lee
Ranch Hand

Joined: Aug 05, 2001
Posts: 2545
hi:
fyi:
Class HashMap;
Class HashMap;
HashMap
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
How does get( key ) work when no HashTable has been populated or even declared?
How's it goin' Doco? Do you mean HashMap? That's what your code shows. A HashMap will return null, a HashTable will throw an NPE. So for your getString() method, the String "null" would be returned.


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Actually a HashTable won't compile since it is a Hashtable.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: com.javaranch.common - CastMap.getString(...)
 
Similar Threads
Strings
JFileChooser problem
CastMap tools (and JDBC assignment)
I want to know how to use methods furnished below in this program???
JFileChooser 1.5