Looks like no one added any tags here yet for you.
Given:
int [] numbers = new double [8];
numbers [2] = 22.6
What is the correct term(s) for numbers? (Select all that apply)
Array or Array Variable
If you declare an array int[] list = [20,2,15,7] the value at the lowest index:
20
Which keyword modifier prevents a method from being Overriden in a subclass
final
A class can (blank) more than one interface
implement
A class that extends another class is called (choose all that apply)
a subclass, a child class
Which of the following is true about exceptions
We must make either a try catch block, or add a throws clause for all checked exceptions
Adding a Finally block after a Catch block is optional
We do not need to write code to handle certain types of exceptions
Per our class, which of the following are steps to take when creating a new exceptions class?
Do not override the getMessage() method
Create a Default constructor
time exception code one
time limit exceeded. Try again next time!
What happens if you create a method and it throws a checked exception that it does not catch?
The method must be decided with the throws clause and handed by the method in which it is called
What are the differences between a binary and a text file
The classes we use to write to such files
The way in which program writes to them
Text files are human readable and binary files are not
The type of data they can hold
Which best describes what is happening in the following code?
try {
while (true) {
int anInteger = inputStream.readInt();
System.out.println(anInteger);
}
}
catch(EOFException e);
{
//no code here
}
Program will loop until the end of the stream
When we discuss input in relation to files, are we
Talking about data being read from a binary file to a program
Referring to what a user enters in the console that is read by a stream object
Talking about data being read from a text file by a program
What are true about file paths in OS X, Windows 10, and Linux?
Folders in windows are separated by “;” folders in linux and OS X use “;”
Which of the following is true about recursion
Recursive methods are always faster than iterative
Suppose we have a method defined with the following code:
public void methodB(int n)
{
if(n<3)
System.out.print(“Goose”);
else
{
Systen.out.print(“Duck”)
methodB(n-1)
}
}
What would be the output of this code if we called methodB
with a value of 5 for its parameter?
Duck Duck Duck Goose
Which of the following is not true about binary search?
it uses binary numbers in the algorithms
Which of the following is not possible with the add() method of the ArrayList class?
Replace a value at a specific position in the list
Which of the following is an appropriate way to create an ArrayList that holds whole number values?
ArrayList<Integer>myList = newArrayList<Integer>(20)
What is a Text File? How is data stored inside of a text file? Are Java program files considered text files? What is a binary file? How are these different from text files? What type of data may we want to store in binary as opposed to text files?
A text file is a file on a computer system that stores data encoded as a text.
The data stored inside is simply just a series of strings with new lines. Java program files are text files because we can read and write to them as humans.
Binary files are files that are encoded as binary, with no text value.
Binary files are different from text files because, unlike text files, we can’t read binary files without special programs in order to do so.
Which method is not a member of the ArrayList <> class
size()
What is merge sort? Describe the details about its implementation as well as the process that it goes through.
pray
What is binary search?
a searching algorithm used in a sorted array by repeatedly dividing the search interval in half.
What is a recursive method? What purpose do they serve? How do we ensure we avoid infinite recursion when creating recursive methods?
A recursive method is a function or procedure that calls itself in order to solve a problem. To avoid infinite recursion, we need to ensure that the base case(s) will eventually be reached.