Java: Classes and Objects questions and answers well illustrated.
Java: Classes and Objects questions and answers well illustrated. Objects have two properties. One is state. What is the other? - correct answers.Behavior The state of an object is stored in _____ _____ - correct answers.Instance variables The behavior of an object is represented by ______ ______ - correct answers.Instance methods The job of a _____ is to initialize instance variables at the time an object is created. - correct answers.Constructor Nested inside a class declaration are three kinds of declarations. What are they? - correct answers.Constructor declarations Variable declarations Method declarations The words public and private are _____ _____ - correct answers.Access modifiers A method is allowed to have _______, which represent data that will be supplied when the method is called. - correct answers.Parameters Once a class has been declared, we can create objects that belong to the class. We say that these objects are ______ of the class. - correct answers.Instances An object variable doesn't actually store an object. Instead, it stores a ______ to an object. - correct answers.Reference The keyword ______ is placed before a class name in order to create an object. - correct To perform an operation on an object, we _______ one of the instance methods associated with the object. - correct answers.Call How do you call an instance method - correct dname(arguments) Reference variables are known as _______ variables in other programming languages. - correct answers.Pointer What value can we assign to an object variable to indicate that it doesn't currently store an object? - correct A new object that's been created by copying an existing object is said to be a _______. - correct answers.Clone An object that's no longer accessible through any object variable is said to be _______. - correct answers.Garbage An instance method that returns the value of an instance variable is said to be an _______. - correct answers.Accessor/Getter An instance method that stores its parameter into an instance variable is said to be an ________. - correct answers.Mutator/Setter An object whose instance variables cannot be changed is said to be _______. - correct answers.Immutable A mehtod that returns the contents of an object as a string should be named ______. - correct String The act of joining two strings together to form a single string is called _______. - correct answers.Concatenation Which method is used to remove extra space from the beginning and end of a string? - correct What is the value of 11 + 38 + "THX"? - correct answers.49THX
Written for
- Institution
- Java: Classes and Objects
- Course
- Java: Classes and Objects
Document information
- Uploaded on
- September 12, 2023
- Number of pages
- 2
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
java classes and objects questions
Also available in package deal