You are on page 1of 4

reference variables - What type of variables can we use with the java.util.

Collections
Class?
an index - What do Lists have in common?
Vector - What type of List is used with synchronized access?
SortedList - Which of this interface is not a part of Java's collection framework?
clear() - Which of these methods deletes all the elements from invoking collection?
WeakHashMap doesn't allow null keys and null values. - Which of the following is
not true in case of a WeakHashMap?

true - You can't put null elements into Queues in the API?

false - OutputStrean is the superclass of all classes representing an output stream of


bytes.

false - The display(int) method of OutputStream Class is used to write a byte to the
current output stream.

true - In Java, 3 streams are created for us automatically.

true - System.err is the standard error stream.

flush() - A method of the FileWriter class that flushes the data of FileWriter.
FileReader (File file) - A constructor of the FileReader class that creates a new file
and get its file name in file objects.
false - create (char[] c) is a method of the FileWriter class that is used to write char array
into FileWriter.

True- close() is a method of the FileWriter class that is used to close the FileWriter.

write (char[] c) - A method of the FileWriter class that is used to write char array
into FileWriter.

Coding shortcuts

Which of the following is a benefit of using the Java Collections Framework?


true

There are no direct implementation of the Collection interface?

fill()

Which of these methods sets every element of a List to a specified object?

Array

What type of collection has always been type safe

compare()

Which method do we need to implement in the java.util.Comparator interface?

Set

What type of collection would we use if we wanted no duplicates?

Speed

What do maps care about

No

Can we have a sorted and unordered set?


WeakHashMap doesn't allow null keys and null values.

Which of the following is not true in case of a WeakHashMap?

true

A stream is composed of bytes

false

In Java, 2 streams are created for us automatically.

true

An output stream accepts output bytes and sends them to some sink.

System.out

This the standard output stream.

You might also like