Question 113.64 pts
Which of the following collection classes implements the List<E> interface? (Select all that are correct)
Group of answer choices

LinkedList<E>

Map<K,V>

ArrayList<E>

Set<E>
 
Flag question: Question 2
Question 213.64 pts
Which statement best describes the Java Collections Framework's Set<E> ?
Group of answer choices

A Set is a collection that contains no duplicate elements.

A Set is a collection of values which must not intersect with any other Set.

A Set is a collection of no more than 6 tennis games, not counting tie- breakers.

A Set is a collection that must contain duplicate values.
 
Flag question: Question 3
Question 313.64 pts
Which of these JDK packages contains the primary Collection classes and interfaces?
Group of answer choices

java.awt

java.collection

java.util

java.lang
 
Flag question: Question 4
Question 413.64 pts
Which of the following statement(s) are true about ArrayList<E>? (Select all that are correct)
Group of answer choices

An ArrayList<String> provides type-safety by only allowing adding objects of type String.

The number of elements currently in an ArrayList is available using the size() method.

The number of elements in an ArrayList cannot be changed after it is instantiated.

The indexing operator [] can be used to get/set elements of an ArrayList, just like it can be used on an array.
 
Flag question: Question 5
Question 513.64 pts
Which of the following classes enforces the constraint that every element is unique?
Group of answer choices

ArrayList<T>

Array

TreeSet<T>

Stack<T>
 
Flag question: Question 6
Question 613.64 pts
Below statement True or False?

Throws keyword is used for handling checked exceptions. By using throws, we can declare multiple exceptions at one time

Group of answer choices

True

False
 
Flag question: Question 7
Question 713.64 pts
Which of these keywords is used to manually/explicitly throw an exception?
Group of answer choices

finally

throw

throws

invoke
 
Flag question: Question 8
Question 813.64 pts
Which of the following Java Collection Framework (JCF) classes implement Set<E>? (Select all that are correct)
Group of answer choices

TreeSet<E>

MapSet<E>

UpSet<E>

EnumSet<E>

HashSet<E>
 
Flag question: Question 9
Question 913.64 pts
Which of these exceptions is thrown in cases when the file specified for writing is not found?
Group of answer choices

InvalidFileException

FileInputException

FileNotFoundException

FileException
 
Flag question: Question 10
Question 1013.64 pts
Which of the following classes implement the Map<K,V> interface? (Select all that are correct)
Group of answer choices

StateMap<K,V>

EnumMap<K,V>

TreeMap<K,V>

HashMap<K,V>

LinkedMashHap<K,V>
 
Flag question: Question 11
Question 1113.64 pts
Which of the following best describes a map in the Java Collections Framework?
Group of answer choices

A map is a collection of unique values where each value is associated with one or more keys.

A map is a collection of unique keys where each key is associated with a value.

A map is a collection of unique keys where each key is associated with one or more values.

A map is a special collection used for geo-location.
 
Flag question: Question 12
Question 1213.63 pts
The InputStream class is used to read data _________ from a data source. 
Group of answer choices

Byte by Byte

Array by Array

String by String

Character by Character
 
Flag question: Question 13
Question 1313.63 pts
The ______________  package contains the Java I/O stream classes
Group of answer choices

java.io

java.file

java.input

java.inout
 
Flag question: Question 14
Question 1413.63 pts
The core components of Java NIO are: 

(Select all that are correct)

Group of answer choices

Channels

Buffers

Scanner

Selectors

Non-blocking I/O
 
Flag question: Question 15
Question 1513.63 pts
In Java, the stream that is intended for general purpose IO(Input/output), not usually character data, is called ___________
Group of answer choices

Reader

Writer

Byte Stream

Character Stream
 
Flag question: Question 16
Question 1613.63 pts
The scanner class provides methods __________ and__________ which can be used to read a file line by line until an "End of File" (EOF) character is reached.   (Select all that are correct)
Group of answer choices

hasNextLine()

readingdata()

readingnextline()

nextLine()
 
Flag question: Question 17
Question 1713.63 pts
What is an I/O Stream in Java?
Group of answer choices

I/O Stream is a framework that provides an architecture to store and manipulate the group of objects.

I/O Stream is a sequence of characters that exist as a single object.

I/O Stream is a conceptually endless flow of data

I/O Stream is a container object that holds a ﬁxed number of values of a single type.
 
Flag question: Question 18
Question 1813.64 pts
Can we deﬁne a Functional Interface without using the "@FunctionalInterface" annotation?
Group of answer choices

True

False
 
Flag question: Question 19
Question 1913.64 pts
What is a Functional Interface in Java?
Group of answer choices

An interface that contains one or more abstract method

An interface that contains more than one abstract method

An interface that contains no abstract method

An interface that contains only one abstract method
 
Flag question: Question 20
Question 2013.64 pts
Which of the following is correct lambda syntax? (Select all that apply).
Group of answer choices

(x, y) -> {return x*y; };

( x, y) -> x+y;

x->{x+y;};

x , y- > x+y;
 
Flag question: Question 21
Question 2113.64 pts
 Which of the following is a valid lambda expression? 
Group of answer choices

(int i) -> i;

String a, String b -> System.out.print(a+ b);

(int i) -> i++; return i;

() -> return;
 
Flag question: Question 22
Question 2213.64 pts
What is the output of the following program?

@FunctionalInterface
interface MyFunctionalInterface {
  public Integer sqr(int a);

  default String sqr(String a) {
    return a + a;
  }
}

public class Test {
  public static void main(String[] args) {
    MyFunctionalInterface fi = n -> {
      return n * n;
    };
    System.out.println(fi.sqr(5));
  }
}
Group of answer choices

Unresolved compilation problems: Duplicate default methods named sqr with the parameters (String) and (int) are inherited from the type MyFunctionalInterface

RedundantMethodException

55

25