Exam 3: Using Methods, Classes, and Objects
Exam 1: Creating Java Programs68 Questions
Exam 2: Using Data74 Questions
Exam 3: Using Methods, Classes, and Objects68 Questions
Exam 4: More Object Concepts67 Questions
Exam 5: Making Decisions70 Questions
Exam 6: Looping72 Questions
Exam 7: Characters, Strings, and the Stringbuilder73 Questions
Exam 8: Arrays74 Questions
Exam 9: Advanced Array Concepts74 Questions
Exam 10: Introduction to Inheritance70 Questions
Exam 11: Advanced Inheritance Concepts70 Questions
Exam 12: Exception Handling65 Questions
Exam 13: File Input and Output74 Questions
Exam 14: Introduction to Swing Components74 Questions
Exam 15: Advanced Gui Topics69 Questions
Exam 16: Graphics74 Questions
Exam 17: Applets, Images, and Sound72 Questions
Select questions type
Any class can contain an unlimited number of methods.
Free
(True/False)
4.8/5
(41)
Correct Answer:
True
How do you create an instance of a class? Provide an example.
Free
(Essay)
4.8/5
(30)
Correct Answer:
A two-step process creates an object that is an instance of a class. First, you supply a type and an identifier-just as when you declare any variable-and then you allocate computer memory for that object. For example, you might define an integer as int someValue; and you might define an Employee as follows: Employee someEmployee;. In this statement, someEmployee stands for any legal identifier you choose to represent an Employee.
Explain the purpose of a return type of a method. Describe the return value of a method that returns no data.
Free
(Essay)
4.8/5
(46)
Correct Answer:
A return type describes the type of data the method sends back to its calling method. Not all methods return a value to their calling methods; a method that returns no data has a return type of void.
A(n) ____________________ is a number appended to a field, typically an ID number or account number.
(Short Answer)
4.9/5
(39)
Methods used with object instantiations are called ____ methods.
(Multiple Choice)
4.9/5
(30)
Match each term with the correct statement below.
-Used to return a value back to the calling method
(Multiple Choice)
4.9/5
(34)
Does a programmer need to write every class he or she uses? Why or why not?
(Essay)
4.8/5
(47)
You are ____ required to write a constructor method for a class.
(Multiple Choice)
4.8/5
(38)
A(n) ____ is a program module that contains a series of statements that carry out a task.
(Multiple Choice)
4.9/5
(32)
A(n) ____ causes a value to be sent from a called method back to the calling method.
(Multiple Choice)
4.8/5
(38)
public int getStudentNum()
{
return studentNum;
}
In the above code, identify if the method is a mutator method or an accessor method. Describe how the two types of methods differ and how they are similar.
(Essay)
4.8/5
(29)
Methods use memory locations to hold values of variables. Describe the process of memory allocation and variable scope.
(Essay)
4.8/5
(35)
____ parameters are variables in a method declaration that accept the values from the actual parameters.
(Multiple Choice)
4.8/5
(37)
Parentheses - may contain data to be sent to the method, but may be empty if no outside data is required
(Essay)
4.9/5
(42)
To execute a method, you ____________________ it from another method.
(Short Answer)
4.7/5
(40)
For ease in locating class methods, many programmers store them in ____ order.
(Multiple Choice)
4.9/5
(39)
Public classes are accessible by all objects, which means that public classes can be ____, or used as a basis for any other class.
(Multiple Choice)
4.9/5
(39)
____ is the encapsulation of method details within a class.
(Multiple Choice)
4.9/5
(37)
Showing 1 - 20 of 68
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)