Exam 5: Methods
Exam 1: Introduction to Computers and Java42 Questions
Exam 2: Java Fundamentals53 Questions
Exam 3: Decision Structures52 Questions
Exam 4: Loops and Files48 Questions
Exam 5: Methods50 Questions
Exam 6: A First Look at Classes49 Questions
Exam 7: A First Look at Gui Applications49 Questions
Exam 8: Arrays and the Arraylist Class52 Questions
Exam 9: A Second Look at Classes and Objects40 Questions
Exam 10: Text Processing and More About Wrapper Classes49 Questions
Exam 11: Inheritance49 Questions
Exam 12: Exceptions and Advanced File Io46 Questions
Exam 13: Advanced Gui Applications46 Questions
Exam 14: Applets and More39 Questions
Exam 15: Recursion34 Questions
Exam 16: Sorting, Searching, and Algorithm Analysis46 Questions
Exam 17: Generics50 Questions
Exam 18: Collections50 Questions
Exam 19: Array-Based Lists20 Questions
Exam 20: Linked Lists36 Questions
Exam 21: Stacks and Queues36 Questions
Exam 22: Binary Trees, Avl Trees, and Priority Queues45 Questions
Select questions type
A parameter variable's scope is the method in which the parameter is declared.
Free
(True/False)
4.8/5
(34)
Correct Answer:
True
This part of a method is a collection of statements that are performed when the method is executed.
Free
(Multiple Choice)
4.8/5
(34)
Correct Answer:
C
A value-returning method must specify this as its return type in the method header.
(Multiple Choice)
4.8/5
(34)
In the following code,System.out.println(num)is an example of _________. double num = 5.4;
System.out.println(num);
Num = 0.0;
(Multiple Choice)
4.8/5
(36)
The expression in a return statement can be any expression that has a value.
(True/False)
4.8/5
(30)
To document the return value of a method,use this in a documentation comment.
(Multiple Choice)
4.8/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.9/5
(34)
Which of the following would be a valid method call for the following method? public static void showProduct (int num1,double num2)
{
Int product;
Product = num1 * (int)num2;
System.out.println("The product is " + product);
}
(Multiple Choice)
4.8/5
(32)
Any method that calls a method with a throws clause in its header must
(Multiple Choice)
4.9/5
(36)
You should always document a method by writing comments that appear
(Multiple Choice)
4.7/5
(39)
What will be returned from the following method? public static int methodA()
{
Double a = 8.5 + 9.5;
Return a;
}
(Multiple Choice)
4.7/5
(35)
In the method header,the method modifier public means that the method belongs to the class,not a specific object.
(True/False)
4.8/5
(35)
When an object,such as a String,is passed as an argument,it is
(Multiple Choice)
4.8/5
(33)
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
(32)
Showing 1 - 20 of 50
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)