Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Java in General
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Ron McLeod
Tim Cooke
Liutauras Vilda
Jeanne Boyarsky
Sheriffs:
Paul Clapham
Rob Spoor
Junilu Lacar
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Piet Souris
Carey Brown
Bartenders:
Forum:
Java in General
Can we Pass Primitive data type in HashMap?
sumanta panda
Ranch Hand
Posts: 224
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Dear All,
I know in the HashMap the Key and Value is as an Object?
Can we pass Primitive data type in the Hashmap?
If yes please suggest How do you store a primitive data type within a HashMap?
Thanks and Regards,
SPanda
John de Michele
Rancher
Posts: 600
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Sumanta:
No, you cannot put primitives in any of the Collections classes. However, you can use the wrapper classes, and then use autounboxing.
John.
Consider Paul's
rocket mass heater
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
is java pass by value or pass by reference?
int VS Integer
Anybody jus started preparation for SCJP?
Casting in array
confusion in pass by reference
More...