Save
Upgrade to remove ads
Busy. Please wait.
Log in with Clever
or

show password
Forgot Password?

Don't have an account?  Sign up 
Sign up using Clever
or

Username is available taken
show password


Make sure to remember your password. If you forget it there is no way for StudyStack to send you a reset link. You would need to create a new account.
Your email address is only used to allow you to reset your password. See our Privacy Policy and Terms of Service.


Already a StudyStack user? Log In

Reset Password
Enter the associated with your account, and we'll email you a link to reset your password.
focusNode
Didn't know it?
click below
 
Knew it?
click below
Don't Know
Remaining cards (0)
Know
0:00
Embed Code - If you would like this activity on your web page, copy the script below and paste it into your web page.

  Normal Size     Small Size show me how

CCS0070 M9-M10

QuestionAnswer
What are we referring to when we mention java.util.Collections We never mention this The Collections framework A utilility class for use with collections The interface from which lists, queues and sets extend A utilility class for use with collections
Which of these interface is not a part of Java's collection framework? SortedMap List Set SortedList SortedList
[T/F] We can use any object with the methods of the java.util.Arrays class? True
[T/F] Can we have a sorted and unordered map? False
What is the correct difference between HashSet and HashMap? long HashSet contains only values whereas HashMap contains the key and value pair. HashSet can contain duplicate elements whereas HashMap contains only unique elements. HashSet contains only values whereas HashMap contains the key and value pair.
[T/F] Within a PriorityQueue the elements sorted last are processed first? False
Which of the following is not true for a generic collection? Generic collection is typesafe and checked at compile time. Generic collection doesn't require typecasting. Generic collection is not mutable. None Generic collection is not mutable.
Which of the following method you need to override for using an object as key in a HashMap? hashValue() hashKey() None hashCode() hashCode()
What type of ordering does a PriorityQueue have? unordered and unsorted ordered and sorted ordered and unsorted ordered and sorted
[T/F] Java In/Ou is used to process the input and produce the output. False
[T/F] System.out.print is the standard output stream True
___________ is used to write data to a destination; it may be a file, an array, peripheral device or socket. OutStream OutputStream StreamOutput StreamOut OutputStream
[T/F] The write(byte[]) method of OutputStream Class is used to write an array of byte to the current output stream. True
[T/F] In Java, 2 streams are created for us automatically. False
A method of the FileWriter class that is used to write char array into FileWriter. inscribe (char[] c) engrave (char [] c) write (char[] c) create (char[] c) write (char[] c)
A method of the FileWriter class that flushes the data of FileWriter. close() flush() exit() expel() flush()
A constructor of the Filewriter class that creates a new file and get its file name in file objects. FileWriter(Character file) FileWriter(String file) FileWriter(File file) FileWriter(Byte file) FileWriter(File file)
What are the valid Constructors of FileReader class? (choose two) FileReader (Byte file) FileReader (String file) FileReader (File file) FileReader (Character file) FileReader(String file) and FileReader(File file)
[T/F] close() is a method of the FileWriter class that is used to close the FileWriter. True
What type of variables can we use with the java.util.Collections Class? both primitive variables reference variables neither reference variables
What type of exception is raised when we run a program with objects that are not mutually comparable in a sorted set? RuntimeException None ClassCastException OutOfBoundsException ClassCastException
Which List class is synchronized? LinkedList Vector ArrayList Vector
Which of these interface handle sequences? Collection Set Comparator List List
[T/F] We can use any object with the methods of the java.util.Arrays class? True
Which of the following is a correct difference between List and Set? List maintains no order whereas Set maintains ascending order. List can hold duplicate elements while Set includes only unique elements. List can hold duplicate elements while Set includes only unique elements.
Which of the following is not true for a generic collection? Generic collection doesn't require typecasting. Generic collection is not mutable. Generic collection is typesafe and checked at compile time. None Generic collection is not mutable.
What type of Queue is a PriorityQueue? FIFO LIFO PIPO PIPO (Priority-In-Priority-Out)
What is the correct difference between HashMap and TreeMap? HashMap maintains no order but TreeMap maintains ascending order. HashMap can contain duplicate elements whereas TreeMap contains only unique elements. HashMap maintains no order but TreeMap maintains ascending order.
What is the correct difference between HashSet and HashMap? HashSet can contain duplicate elements whereas HashMap contains only unique elements. HashSet contains only values whereas HashMap contains the key and value pair. HashSet contains only values whereas HashMap contains the key and value pair.
[T/F] Automatically created streams are attached with the GUI. False
[T/F] OutputStream is used to write data to a destination; it may be a file, an array, peripheral device or socket. True
[T/F] The write(int) method of OutputStream Class is used to write a byte to the current output stream. True
[T/F] The flush() method of OutputStream Class is used to close the current output stream. False
[T/F] System.in is the standard input stream. True
In using __________, unlike FileOutputStream class, you don't need to convert string into byte array because it provides method to write string directly. WriteFile class FileWriter class WriterFile class FileWrite class FileWriter class
[T/F] FileWriter(File file) is a constructor of the Filewriter class that creates a new file and get its file name in file objects. True
A method of the FileWriter class that is used to close the FileWriter. flush() close() expel() exit() close()
[T/F] The FileReader (String file) is the constructor of the FileReader class that creates a new file and get its file name in string True
What type of variables can we use with the java.util.Arrays class? primitive variables reference variables both neither both
Which of these is Basic interface that all other interface inherits? Array Set Collection List Collection
Which of the following is a correct difference between ArrayList and LinkedList? ArrayList uses a single linked list whereas the LinkedList uses dynamic array. ArrayList uses a dynamic array whereas the LinkedList uses doubly linked list. ArrayList uses a dynamic array whereas the LinkedList uses doubly linked list.
What type of collection has always been type safe Map Queue Array List Set Array
Which of these interface is not a part of Java's collection framework? SortedList List Set SortedMap SortedList
What is the design pattern followed by Iterator? Iterator design pattern Observer design pattern None Factory design pattern Iterator design pattern
[T/F] A PriorityQueue is always sorted in natural order? False
Which of the following is a correct difference between List and Set? Can hold duplicate elements while Set includes only unique elements. Contain only unique elements whereas Set can contain duplicate elements. Can hold duplicate elements while Set includes only unique elements.
What type of collection does not extend the Collection interface? Map Set Queue List Map
Which of the following is not true in case of a WeakHashMap? WeakHashMap is a Hash table based implementation of the Map interface with weak keys. WeakHashMap doesn't allow null keys and null values. WeakHashMap doesn't allow null keys and null values.
This the standard output stream. System.in System.err System.out System.out
[T/F] A string is a sequence of data. False
[T/F] The display(byte[]) method of OutputStream Class is used to write an array of byte to the current output stream. False
[T/F] An output stream accepts output bytes and sends them to some sink. True
[T/F] Java In/Ou is used to process the input and produce the output. False
In using __________, unlike FileOutputStream class, you don't need to convert string into byte array because it provides method to write string directly. FileWriter class WriteFile class FileWrite class WriterFile class FileWriter class
[T/F] create (String text) is a method of the FileWriter class that is used to write the string into FileWriter. False
[T/F] The ReaderFile (String file) is the constructor of the FileReader class that creates a new file and get its file name in string False
[T/F] create (char[] c) is a method of the FileWriter class that is used to write char array into FileWriter. False
[T/F] write (String text) is a method of the FileWriter class that is used to write the string into FileWriter. True
When would you choose to use ArrayList over LinkedList in an application? ArrayList is preferred when there is more demand for get via index operations.
Is the following code snippet valid? List aList = new ArrayList(); Yes
[T/F] You can't put null elements into Lists in the API? False
Which method do we need to implement in the java.util.Comparator interface? compare() sort() compareTo() sortTo() compare()
Which of these methods sets every element of a List to a specified object? Complete() set() add() fill() fill()
What type of collection does not extend the Collection interface? List Map Queue Set Map
[T/F] A PriorityQueue is always sorted in natural order? False
What do sets care about Index Speed Uniqueness Uniqueness
Which of the following is a correct difference between List and Set? List maintains no order whereas Set maintains ascending order. List can hold duplicate elements while Set includes only unique elements. List can hold duplicate elements while Set includes only unique elements.
What is the design pattern followed by Iterator? Observer design pattern Factory design pattern None Iterator design pattern Iterator design pattern
[T/F] The erase() method of OutputStream Class flushes the current output stream. False
It is the superclass of all classes representing an output stream of bytes. OutputStream StreamOut StreamOutput OutStream OutputStream
[T/F] System.err is the standard error stream. True
[T/F] The display(int) method of OutputStream Class is used to write a byte to the current output stream. False
[T/F] Java In/Ou is used to process the input and produce the output. False
A constructor of the FileReader class that creates a new file and get its file name in file objects. FileReader (Byte file) FileReader (File file) FileReader (Character file) FileReader (String file) FileReader (File file) & FileReader (String file)
A method of the FileWriter class that is used to close the FileWriter. flush() exit() expel() close() close()
[T/F] Java FileReader class returns data in byte format like FileInputStream class. True
[T/F] The FileReader (File file) is the constructor of the FileReader class that creates a new file and get its file name in file objects. True
A method of the FileWriter class that is used to write the string into FileWriter. inscribe (String text) create (String text) engrave (String text) write (String text) write (String text)
Which interface would we use to sort a class that can't be modified? java.lang.Comparable java.util.Comparator java.util.Comparator
What type of collections are Lists? ordered sorted unordered ordered
Which List would you use if wanted fast access and were doing lots of insertions and deletions? LinkedList Vector ArrayList LinkedList
Which List class is synchronized? ArrayList Vector LinkedList Vector
Is the following code snippet valid? public class SimpleGenericInterfaceImpl implements SimpleGenericInterface { ? Yes
Which of the following is a correct difference between HashSet and TreeSet? TreeSet maintains no order while HashSet maintains ascending order. HashSet maintains no order while TreeSet maintains ascending order. HashSet maintains no order while TreeSet maintains ascending order.
Which of the following is not true for a fail-fast iterator? Fail fast system reports the failure right away but the system recovers after the failure. Fail fast immediately reports any failure and fail fast system fails whenever a problem occurs. Fail fast system reports the failure right away but the system recovers after the failure.
What is the correct difference between HashMap and TreeMap? None HashMap contains only values whereas TreeMap contains key and values both. HashMap maintains no order but TreeMap maintains ascending order. HashMap maintains no order but TreeMap maintains ascending order.
[T/F] You can't put null elements into Queues in the API? True
[T/F] System.util.Scanner is the standard input stream. False
[T/F] Java In/Ou is used to process the input and produce the output. False
[T/F] Automatically created streams are attached with the GUI. False
________ is used to process the input and produce the output. Java I/O Java Collection Java Stream Java I/O
[T/F] OutputStream is used to write data to a destination; it may be a file, an array, peripheral device or socket. True
[T/F] Java FileReader class is used to read data from the file. True
[T/F] create (char c) is a method of the FileWriter class that is used to write the char into FileWriter. False
[T/F] In using FileWriter class, unlike FileOutputStream class, you don't need to convert string into byte array because it provides method to write string directly. True
[T/F] In using FileWriter class, like FileOutputStream class, you need to convert string into byte array because it provides method to write string directly. False
A method of the FileWriter class that is used to write the string into FileWriter. create (String text) write (String text) engrave (String text) inscribe (String text) write (String text)
Can we have a sorted and unordered map? Yes No No
Which of these is Basic interface that all other interface inherits? Collection List Array Set Collection
Which interface would we use to sort a class that can't be modified? java.util.Comparator java.lang.Comparable java.util.Comparator
Which of the following is a correct method to convert the array of strings into a list? Arrays class toList() method Arrays class asList() method Arrays class doList() method None Arrays class asList() method
What do Lists have in common? an index nothing element uniqueness an index
What is the correct difference between HashMap and TreeMap? HashMap maintains no order but TreeMap maintains ascending order. HashMap can contain duplicate elements whereas TreeMap contains only unique elements. None HashMap maintains no order but TreeMap maintains ascending order.
Which of the following method you need to override for using an object as key in a HashMap? None hashCode() hashKey() hashValue() hashCode()
Which of the following class doesn't implement the Set interface? TreeSet HashSet None of the above LinkedHashSet None of the above
What type of collection does not extend the Collection interface? Queue List Set Map Map
[T/F] An output stream accepts output bytes and sends them to some sink. True
[T/F] A stream is a sequence of data. True
An _________ accepts output bytes and sends them to some sink. OutStream OutputStream StreamOut StreamOutput OutputStream
[T/F] The java.io package contains all the classes required for input and output operations. True
This the standard input stream. System.out System.err System.in System.in
[T/F] In using FileWriter class, unlike FileOutputStream class, you don't need to convert string into byte array because it provides method to write string directly. True
In using __________, unlike FileOutputStream class, you don't need to convert string into byte array because it provides method to write string directly. FileWrite class WriteFile class WriterFile class FileWriter class FileWriter class
[T/F] flush () is a method of the FileWriter class that is used to close the FileWriter. False
A constructor of the FileReader class that creates a new file and get its file name in string FileReader (Character file) FileReader (File file) FileReader (Byte file) FileReader (String file) FileReader (String file)
[T/F] Java ReadFile class is a character-oriented class which is used for file handling in java. False
What type of collections are Lists? sorted unordered ordered ordered
Which of the following is not true for the UnsupportedOperationException? It occurs if a method is not found in the underlying collection. None This exception implies that the requested operation is not supported. It occurs if a method is not found in the underlying collection.
[T/F] If two arrays hold the same elements they are considered equal by the Arrays.equals() method? False
Which of the following is the difference between ArrayList and LinkedList? ArrayList uses a dynamic array where the LinkedList uses doubly linked list. ArrayList uses a single linked list where the LinkedList uses dynamic array. ArrayList uses a dynamic array whereas the LinkedList uses doubly linked list.
What is the correct difference between HashSet and HashMap? long HashSet maintains no order whereas HashMap maintains ascending order. HashSet contains only values whereas HashMap contains the key and value pair. HashSet contains only values whereas HashMap contains the key and value pair.
What do sets care about Uniqueness Speed Index Uniqueness
Which of the following method you need to override for using an object as key in a HashMap? hashValue() hashKey() hashCode() None hashCode()
What type of set would you use if you wanted it sorted? HashSet TreeSet LinkedHashSet TreeSet
All are valid codes in printing message in the console, except one. System.out.printf("%s","Hello"); System.out.print("Hello"); System.out.println("Hello"); System.out.print="Hello"; System.out.print="Hello";
[T/F] Java In/Ou is used to process the input and produce the output. False
[T/F] Automatically created streams are attached with the console. True
[T/F] An output strean accepts output bytes and sends them to some sink. False
[T/F] write (char c) is a method of the FileWriter class that is used to write the char into FileWriter. True
[T/F] FileWriter(String file) is a constructor of the Filewriter class that creates a new file and get its file name in string True
[T/F] flush() is a method of the FileWriter class that flushes the data of FileWriter. True
[T/F] Java ReadFile class is used to read data from the file. False
[T/F] The ReaderFile (String file) is the constructor of the FileReader class that creates a new file and get its file name in string False
Which of these is Basic interface that all other interface inherits? Array Collection List Set Collection
Which of these packages contain all the collection classes? java.util
What type of exception is raised when we try run a program with objects that are not mutually comparable in a sorted map? None ClassCastException RuntimeException OutOfBoundsException ClassCastException
Which List would you use if wanted fast access and were doing lots of insertions and deletions? ArrayList Vector LinkedList LinkedList
Which of these classes is not part of Java's collection framework? Queue Maps Array Stack Queue
What type of collection would we use if we wanted no duplicates? Queue Map Set List Set
Can we have a sorted and unordered set? Yes
[T/F] You can't put null elements into Queues in the API? false true True
[T/F] The write(int) method of OutputStream Class is used to write a byte to the current output stream. True
A stream is composed of ______ character digits bytes bit bytes
The ______ method of OutputStream Class is used to close the current output stream. close()
________ is used to process the input and produce the output. Java I/O
[T/F] read () is a method of the FileReader class that is used to return a character in ASCII form. It returns -1 at the end of file. True
Which of these is static variable defined in Collections? EMPTY_SET EMPTY_MAP EMPTY_LIST All of the mentioned All of the mentioned
Which of the following is a correct method to convert the array of strings into a list? Arrays class asList() method None Arrays class doList() method Arrays class toList() method Arrays class asList() method
What type of exception is raised when we run a program with objects that are not mutually comparable in a sorted set? None OutOfBoundsException ClassCastException RuntimeException ClassCastException
Which of the following is a correct difference between ArrayList and LinkedList? ArrayList uses a dynamic array whereas the LinkedList uses doubly linked list. ArrayList uses a doubly linked list whereas the LinkedList uses dynamic array. ArrayList uses a dynamic array whereas the LinkedList uses doubly linked list.
Which of the following is not true for a generic collection? None Generic collection doesn't require typecasting. Generic collection is typesafe and checked at compile time. Generic collection is not mutable. Generic collection is not mutable.
What type of collection would we use if we wanted no duplicates? Set Map List Queue Set
[T/F] System.error is the standard error stream. False
[T/F] Java ReadFile class is a character-oriented class which is used for file handling in java. False
A constructor of the FileReader class that creates a new file and get its file name in file objects. FileReader (Character file) FileReader (String file) FileReader (File file) FileReader (Byte file) FileReader (File file)
Created by: user-1798141
 

 



Voices

Use these flashcards to help memorize information. Look at the large card and try to recall what is on the other side. Then click the card to flip it. If you knew the answer, click the green Know box. Otherwise, click the red Don't know box.

When you've placed seven or more cards in the Don't know box, click "retry" to try those cards again.

If you've accidentally put the card in the wrong box, just click on the card to take it out of the box.

You can also use your keyboard to move the cards as follows:

If you are logged in to your account, this website will remember which cards you know and don't know so that they are in the same box the next time you log in.

When you need a break, try one of the other activities listed below the flashcards like Matching, Snowman, or Hungry Bug. Although it may feel like you're playing a game, your brain is still making more connections with the information to help you out.

To see how well you know the information, try the Quiz or Test activity.

Pass complete!
"Know" box contains:
Time elapsed:
Retries:
restart all cards