• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 2 fuera de 8 páginas
Examen

CS 170 Test 3: Objects and Classes || Already Graded A+.

Document preview thumbnail
Vista previa 2 fuera de 8 páginas

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

Vista previa del contenido

CS 170 Test 3: Objects and Classes || Already Graded A+.
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)

Información del documento

Subido en
25 de marzo de 2025
Número de páginas
8
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas
$11.49

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
SirAnton
3.7
(118)
Vendido
811
Seguidores
438
Artículos
40316
Última venta
1 semana hace




Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes