aspose file tools*
The moose likes Beginning Java and the fly likes equals method, hash code, and serializing a file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "equals method, hash code, and serializing a file" Watch "equals method, hash code, and serializing a file" New topic
Author

equals method, hash code, and serializing a file

pamela jones
Greenhorn

Joined: Apr 26, 2003
Posts: 5
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?
Joel McNary
Bartender

Joined: Aug 20, 2001
Posts: 1815
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?


Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
Kathy Sierra
Cowgirl and Author
Ranch Hand

Joined: Oct 10, 2002
Posts: 1572
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: equals method, hash code, and serializing a file
 
Similar Threads
program button to perform FTP
Incompatible type issue
cannot read a Collection of a custom class as a parameter
Call a method from another class!!
Ftp test help