1/15
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No study sessions yet.
What are the benefits of using a method?
Reuse code, Reduce complexity, Easy to maintain
What keyword can be used as a return type for a method that does not return any value?
void
What is the output of the call nPrint('a', 4)?
invalid call
Which method header correctly returns the price of a product?
public static double getPrice(double basePrice, double taxRate)
Which method header tests whether a number is even and returns true if it is?
public static boolean isEven(int number)
What is the value of k after invoking nPrint("A message", k) with k initialized to 2?
2
What happens when an array is passed to a method in Java?
The reference to the original array is passed — no new array is created.

What is the content of the list after the first iteration of the Selection Sort method with list {3.1, 3.1, 2.5, 6.4, 2.1}?
{2.1, 3.1, 2.5, 6.4, 3.1}
What is the output of the following code: System.out.print(matrix[i][1] + " ") in a 4x4 matrix?
2 5 9 13
What is the maximum element found in the 2D array {{1, 2}, {3, 4}}?
4

What does UML stand for in Object-Oriented Programming?
Unified Modeling Language
What is a constructor in Object-Oriented Programming?
A special kind of method that is invoked to create an object.
What is the state of an object in Object-Oriented Programming?
Also known as property or attribute, represented by data fields with their current values.
What defines the behavior of an object in Object-Oriented Programming?
Methods.
What is a class in Object-Oriented Programming?
A template, blueprint, or contract that defines what an object's data fields and methods will be.
What is an object in Object-Oriented Programming?
An instance of a class.