title: Whats the difference between objects and data structures?
body: <p>I've been reading the book <a href="https://rads.stackoverflow.com/amzn/click/com/0132350882" rel="noreferrer" rel="nofollow noreferrer"><em>Clean Code: A Handbook of Agile Software Craftsmanship</em></a> and in chapter six pages 95-98 it clarifies about the differences between objects and data structures:</p>
  
  <ul>
  <li><p>Objects hide their data behind abstractions and expose functions that operate on that data. Data structures expose their data and have no meaningful functions.</p></li>
  <li><p>Object expose behavior and hide data. This makes it easy to add new kinds of objects without changing existing behaviors. It also makes it hard to add new behaviors to existing objects.</p></li>
  <li><p>Data structures expose data and have no significant behavior. This makes it easy to add new behaviors to existing data structures but makes it hard to add new data structures to existing functions.</p></li>
  </ul>
  
  <p>I'm a tad bit confused whether some classes are objects or data structures. Say for example HashMaps in java.util, are they objects? (because of its methods like put(), get(), we dont know their inner workings) or are they data structures? (I've always thought of it as data structures because its a Map). </p>
  
  <p>Strings as well, are they data structures or objects?</p>
  
  <p>So far majority of the code I've been writing have been the so called "hybrid classes" which try to act as an object and a data structure as well. Any tips on how to avoid them as well?</p>