Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

equals method, hash code, and serializing a file  RSS feed

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to figure out how to use the equal method and hash code to ensure that my program accepts no duplicates when entering data into the JPanel. I am also trying to figure out how to serialize a file and deserialize it. Any suggestions?
 
Bartender
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1). use a java.util.Set to ensure that there are no duplicates. To see how to use .equals() and .hashCode effectively, see Chapter 3 of Effective Java by Joshua Bloch.
2). What do you mean by serailization/deserialization of files? writing serialized objects to files, or sending files across data streams?
 
Cowgirl and Author
Rancher
Posts: 1589
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy,
I just put up a PDF file of 10 pages on serialization. They are *very* easy to read, but too much to put in a post, and with lots of pictures.

serialization from Head First Java book
It's 400k, and not full printing resolution (that matters because at least half of it is illustrations/graphics).
cheers,
Kathy
-co-author, Head First Java, first in a new book series from O'Reilly
oreilly.com Head First page
-original founder of javaranch
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!