In terms of organization, what do object classes provide? correct answers They are a way to
organize a large number of variables required and/or the relationship between them
Broad answer: What do objects hold/"encapsulate"? correct answers unrelated components that
will be used into more broader programs
What kind of visual are objects compared to? correct answers software "black boxes"
List 2 bad things that can happen if we do not separate the pieces of code that deal with unrelated
components (AKA, if we don't have objects) correct answers - fixing one error can create another
one somewhere else
- makes it harder to re-use code from one project to project
Systems Programmers correct answers - make the building blocks of a program (object classes
and such) that will be used for people's projects
- relevant to hardware and software
Application Programmers correct answers - use the building blocks to create their programs
(don't care about building blocks)
- can also pull apart some things in one object class and put it into another object class (just
would work on a higher level of abstraction than a normal application programmer)
- most of what we've been doing
End users correct answers - only concerned with using the program
- you when you use your email, your browser, your operating system
object-oriented programming correct answers programming using objects
What is the formal definition of an object? correct answers It's an entity that you can manipulate
in your programs (a variable type).
Specific: What do objects consist of? correct answers Data fields (instance variables) and
methods (instance methods)
What do instance variables do for an object? correct answers They define the state of the object
What do instance methods do for an object? correct answers They provide instructions that
accesses or modifies the state of an object
What is a class? correct answers - a construct that defines objects of the same type (a set of
objects with the same properties and a set of actions that they can perform)
- code that tells you how to build an object of a type of class (the blueprint)
- EVERY OBJECT IS TIED TO SOME CLASS
, - includes definitions for all the instance fields of an object (properties of the associated objects)
- includes definitions for all of the instance methods associated with an object (the "actions" that
can be taken by the associated objects)
What is trash? correct answers Me: Miley at the VMAs
Me: Stop shaming her!
Me: But it's true!
Me: You don't know what she's been through! LEAVE MILEY ALONE
Me: Plz get some tea and stop being crazy
What are objects in regards to a class? correct answers a specific instance of a class (use it in
another class by calling it by its name); an actual/realized version of a class (In a non-
programming context, you could think of "dog" as a class and your particular dog as an instance
of that class) ---> (think of a class as your formal parameter and your object as your actual
argument)
What do instance fields/variables define? correct answers - properties of the associated objects
What do instance methods define? correct answers The actions that can be taken by the
associated object
What is a constructor? correct answers - used to construct and initialize objects from the class
- special methods that are called when you create an object
Does a constructor have a return type? Why or why not? correct answers No, because you are
creating an object from a class (the equivalent of creating an array); you don't need to put "void"
because Java already knows that a constructor will not return anything
How does Java know a method is a constructor? correct answers They MUST share the same
name as their class
Can you use method overloading with constructors? correct answers Yes (very common)
Can you declare a class without a constructor? correct answers Yes
What happens when you DON'T declare a constructor? correct answers A no-argument (no
parameter) default constructor with an empty body (one that doesn't do much) gets IMPLICITLY
declared in the class
What does a main method tell the Java Virtual Machine? correct answers - when to start
executing code
Why do coders like to write a main method when you're dealing with objects? correct answers
To test a class and make sure it does what it claims it does
What does it mean to declare a reference variable of an object? correct answers To declare an
instance of the Circle class (or really to declare the object variable)