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(); ();
Written for
- Institution
-
Arizona State University
- Course
-
CSE 110
Document information
- Uploaded on
- March 4, 2023
- Number of pages
- 15
- Written in
- 2022/2023
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
cse 110 exam 2 questions with correct answers
Also available in package deal