Question: Java Programming... Question 1 Java will accept Unix-style forward slashes when specifying folders, even on Windows. Group of answer choices True False Question 2 What
Java Programming...
Question 1
Java will accept Unix-style forward slashes when specifying folders, even on Windows.
Group of answer choices
- True
- False
Question 2
What does the File instance method listFiles() return, when called on a folder?
Group of answer choices
- a File reference pointing to the first file or sub-folder in the folder
- an array of File references, each pointing to a file in the folder
- an array of File references, each pointing to a file or subfolder in the folder
- a Folder object reference; we can use that to loop through the files
Question 3
While ArrayLists seem to magically expand as we add elements to them, and let us easily delete from the middle of them, they are implemented with ordinary arrays which do not offer support for either.
Group of answer choices
- True
- False
Question 4
Generics in Java...
Group of answer choices
- provide a way to write code that will work with any class, without modifying code
- can work with primitive data types as well as objects
are limited to a single type parameter
- have limitations including the inability to create new objects of the generic type
- are easy to abuse and therefore suggest we do additional compiler-assisted checks to be careful
Question 5
When implementing a class meant to serve as a collection, it's typical to write an iterator to let clients loop through collection elements with minimal effort on their part.
Group of answer choices
- True
- False
Question 6
When implementing an iterator, we may want to offer for/each support. To do this...
Group of answer choices
- the collection class must implement the Iterable interface
- do nothing; support is automatic
- the collection class must implement the ForEach interface
- this can't be done; only Java's built-in collections can offer for/each support
Question 7
When writing code that directly works with the user, we may throw exceptions, just like we do in typical Supplier code.
Group of answer choices
- True
- False
Question 8
The purpose of a try/catch block is to intercept code that might "blow up" (terminate the running code) and handle it more gracefully.
Group of answer choices
- True
- False
Question 9
Select the statements that are true about static variables
Group of answer choices
- They pertain to the class, not an object instance of the class
- They can be accessed using the name of the class, a dot, then the name of the variable
- they take up more memory than instance variables
- they can access variables of both static and instance type
Question 10
Select all of the statements that are true about static methods
Group of answer choices
- they are "pure functions" that avoid dynamic dispatch and are therefore faster
- they can access instance data
- they can access static data
- their code can include the keyword "this"
- their code can include the keyword "super"
- they cannot be overriden
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
