CSE 110 - Exam 2 questions with correct answers
What is the purpose of an object's instance variables? CORRECT ANSWER To store the data for a single instance of a class. Suppose you want to work with objects of the Student class. What do you need to know? CORRECT ANSWER The public interface of the class. T/F: S is an object CORRECT ANSWER True T/F: String is an object CORRECT ANSWER False T/F: Suppose that a new version of Java is released, and that the Java compiler changes the way that string objects store characters. If the string methods are updated accordingly, then you won't need to change your code. CORRECT ANSWER True Given class Counter below, how many instances of the Counter class are created in the code segment that follows? public class Counter { private int value; . . . public void count() { value = value + 1; } . . . } Counter points = new Counter(); Counter passengers = new Counter(); ();
Escuela, estudio y materia
- Institución
-
Arizona State University
- Grado
-
CSE 110
Información del documento
- Subido en
- 4 de marzo de 2023
- Número de páginas
- 15
- Escrito en
- 2022/2023
- Tipo
- Examen
- Contiene
- Preguntas y respuestas
Temas
-
cse 110 exam 2 questions with correct answers
Documento también disponible en un lote