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
If you attempt to use a local variable before it has been given a value:
(Multiple Choice)
4.7/5
(33)
What will be returned from the following method?
Public static double methodA()
{
Double a = 8.5 + 9.5;
Return a;
}
(Multiple Choice)
4.9/5
(34)
In the method header, the method modifier public means that the method belongs to the class, not a specific object.
(True/False)
5.0/5
(26)
A special variable that holds a value being passed into a method is called what?
(Multiple Choice)
4.8/5
(33)
The expression in a return statement can be any expression that has a value.
(True/False)
4.8/5
(32)
No statement outside the method in which a parameter variable is declared can access the parameter by its name.
(True/False)
4.7/5
(42)
What will be the result of the following code?
Int num;
String str = "555";
Num = Integer.parseInt(string str) + 5;
(Multiple Choice)
4.9/5
(35)
When a method tests an argument and returns a true or False value, it should return:
(Multiple Choice)
4.9/5
(38)
Given the following method header, which of the method calls would be an error?
Public void displayValues(int x, int y)
(Multiple Choice)
4.9/5
(32)
Which of the following is NOT a benefit derived from using methods in programming?
(Multiple Choice)
4.7/5
(31)
Only constants and variables may be passed as arguments to methods.
(True/False)
4.7/5
(37)
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
(33)
In the method header the static method modifier means the method is available to code outside the class.
(True/False)
4.8/5
(32)
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.9/5
(41)
Showing 41 - 60 of 60
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)