This week's book giveaway is in the Python forum.
We're giving away four copies of Python Continuous Integration and Delivery and have Moritz Lenz on-line!
See this thread for details.
Win a copy of Python Continuous Integration and Delivery this week in the Python 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:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

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
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
 
Those cherries would go best on cherry cheesecake. Don't put those cherries on this tiny ad:
ScroogeXHTML 8.2 - easy to use RTF to HTML converter library
https://coderanch.com/t/707504/ScroogeXHTML-RTF-HTML-XHTML-converter
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!