CS 1103 FINAL Exam QCS 1103 FINAL Exam Questions and Answers 2023/24CS 1103 FINAL Exam Questions and Answers 2023/24CS 1103 FINAL Exam Questions and Answers 2023/24uestions and Answers 2023/24CS 1103 FINAL Exam Questions and Answers 2023/24CS 1103 FINAL Exam Questions and Answers 2023/24
a. The Collection interface is the root interface for manipulating a collection of objects.
b. The Collection interface provides the basic operations for adding and removing elements in
a collection.
c. The AbstractCollection class is a convenience class that provides partial implementation for
the Collection interface.
d. Some of the methods in the Collection interface cannot be implemented in the concrete
subclass. In this case, the method would throw java.lang.UnsupportedOperationException, a
subclass of RuntimeException.
e. All interfaces and classes in the Collections framework are declared using generic type in JDK
1.5.
Question 2
Answer saved
Marked out of 1.00
Flag question
Question text
Which of the following statements are true?
Select one or more:
a. Dialog boxes are defined by subclasses of the class JDialog.
b. The main difference between JDialogs and JFrames is that a dialog box has a parent, which if
closed, causes the dialog box to closes, too.
,c. When a modeless dialog is put up on the screen, the rest of the application is blocked until
the dialog box is dismissed.
d. Modal dialog boxes are like independent windows, since they can stay on the screen while
the user interacts with other windows.
Question 3
Answer saved
Marked out of 1.00
Flag question
Question text
What code is missing to complete the following method for sorting a list?
public static void sort(double[] list) {
___________________________;
}
public static void sort(double[] list, int high) {
if (high > 1) {
// Find the largest number and its index
int indexOfMax = 0;
double max = list[0];
for (int i = 1; i <= high; i++) {
if (list[i] > max) {
max = list[i];
indexOfMax = i;
}
}
// Swap the largest with the last number in the list
list[indexOfMax] = list[high];
list[high] = max;
// Sort the remaining list
sort(list, high - 1);
}
}
Select one:
, a. sort(list)
b. sort(list, list.length)
c. sort(list, list.length - 1)
d. sort(list, list.length - 2)
Clear my choice
Question 4
Answer saved
Marked out of 1.00
Flag question
Question text
What does this code do?
import java.io.*;
// (TextReader.class must be available to this program.)
public class TenLinesWithTextReader {
public static void main(String[] args) {
try {
TextReader in = new TextReader( new FileReader(args[0]) );
for (int lineCt = 0; lineCt < 10; lineCt++)) {
String line = in.getln();
System.out.println(line);
}
}
catch (Exception e) {
System.out.println("Error: " + e);
}
}
} // end class TenLinesWithTextReader
Select one:
a. This code accesses a remote computer and requests 10 HTML pages.
b. This code displays the first ten lines from a text file. The lines are written to standard output.
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller VEVA2K. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $18.99. You're not tied to anything after your purchase.