Study your flashcards anywhere!

Download the official Cram app for free >

  • Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off

How to study your flashcards.

Right/Left arrow keys: Navigate between flashcards.right arrow keyleft arrow key

Up/Down arrow keys: Flip the card between the front and back.down keyup key

H key: Show hint (3rd side).h key

A key: Read text to speech.a key


Play button


Play button




Click to flip

7 Cards in this Set

  • Front
  • Back
What is a class?
A data type that encapsulates both the state of an object and methods that can be performed on the object
What is an object?
An instance of a class
What makes an interface good?
- Simplified view of a component
- Expressed in the vocabulary of the user
What is encapsulation?
Separating a class' interface from its implementation and making only the interface public
How does C++ help with the safety vs. usability tradeoff?
- In C, static variables helped with safety, but didn't allow for multiple instances
- In C, struct's supportm ultiple instances, but don't prevent access
- C++ classes provide safety AND allow multiple instances
Does encapsulation help with security?
No, it just prevents software from depending on something that they shouldn't depend on.
What are the differences between a struct and a class?
- Members of struct are are public by default, members of class are private by default
- Otherwise functionally equivalent

- struct typically has very few members, only public data
- class typically only allows access via methods, with only private data