Exam 5: Methods
Exam 1: Introduction to Computers and Java51 Questions
Exam 2: Java Fundamentals61 Questions
Exam 3: Decision Structures64 Questions
Exam 4: Loops and Files57 Questions
Exam 5: Methods60 Questions
Exam 6: A First Look at Classes58 Questions
Exam 7: Arrays and the Arraylist Class64 Questions
Exam 8: A Second Look at Classes and Objects50 Questions
Exam 9: Text Processing and More About Wrapper Classes60 Questions
Exam 10: Inheritance70 Questions
Exam 11: Exceptions and Advanced File IO56 Questions
Exam 12: A First Look at GUI Applications60 Questions
Exam 13: Advanced GUI Applications58 Questions
Exam 14: Applets and More54 Questions
Exam 15: Creating GUI Applications With Javafx and Scene Builder40 Questions
Exam 16: Recursion42 Questions
Exam 17: Databases48 Questions
Select questions type
Assume that the following method header is for a method in class A. public void displayValue(int value)
Assume that the following code segments appear in another method, also in class A. Which contains a legal call to the displayValue method?
(Multiple Choice)
4.8/5
(45)
When writing the documentation comments for a method, you can provide a description of each parameter by using a:
(Multiple Choice)
4.8/5
(29)
When you pass an argument to a method, be sure that the argument's data type is compatible with:
(Multiple Choice)
4.7/5
(43)
A value-returning method must specify this as its return type in the method header.
(Multiple Choice)
4.9/5
(39)
Which of the following values can be passed to a method that has an int parameter variable?
(Multiple Choice)
4.7/5
(32)
What will be returned from the following method?
Public static int methodA()
{
Double a = 8.5 + 9.5;
Return a;
}
(Multiple Choice)
5.0/5
(40)
In the following code, Integer.parseInt(str), is an example of: int num;
String str = "555";
Num = Integer.parseInt(str) + 5;
(Multiple Choice)
4.9/5
(41)
Given the following method header, which of the method calls would be an error?
Public void displayValues(double x, int y)
(Multiple Choice)
4.7/5
(38)
Any method that calls a method with a throws clause in its header must either handle the potential exception or have the same throws clause.
(True/False)
4.8/5
(37)
A value-returning method can return a reference to a non-primitive type.
(True/False)
4.9/5
(38)
A parameter variable's scope is the method in which the parameter is declared.
(True/False)
4.8/5
(29)
This type of method performs a task and sends a value back to the code that called it.
(Multiple Choice)
4.7/5
(42)
This part of a method is a collection of statements that are performed when the method is executed.
(Multiple Choice)
4.9/5
(37)
Two general categories of methods are void methods and value returning methods.
(True/False)
4.9/5
(38)
When an object, such as a String, is passed as an argument, it is:
(Multiple Choice)
4.9/5
(40)
Showing 21 - 40 of 60
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)