Java MCQ Quiz Hub

Java Mcq Question Set 5

Choose a topic to test your knowledge and improve your Java skills

Which of these classes is not part of Java's collection framework?





✅ Correct Answer: 2

Which of these interface is not a part of Java's collection framework?





✅ Correct Answer: 3

Which of these methods deletes all the elements from invoking collection?





✅ Correct Answer: 4

What is Collection in Java?





✅ Correct Answer: 2

Which of these interface declares core method that all collections will have?





✅ Correct Answer: 2

Which of these interface handle sequences?





✅ Correct Answer: 1

Which of these interface must contain a unique element?





✅ Correct Answer: 1

Which of these is Basic interface that all other interface inherits?





✅ Correct Answer: 3

Which of these is an incorrect form of using method max() to obtain maximum element?





✅ Correct Answer: 2

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





✅ Correct Answer: 1

Which of these methods can randomize all elements in a list?





✅ Correct Answer: 4

Which of these methods can convert an object into a List?





✅ Correct Answer: 2

Which of these is true about unmodifiableCollection() method?





✅ Correct Answer: 1

Which of these is static variable defined in Collections?





✅ Correct Answer: 4

Which of these is used to perform all input & output operations in Java?





✅ Correct Answer: 3

Which of these is a type of stream in Java?





✅ Correct Answer: 4

Which of these classes are used by Byte streams for input and output operation?





✅ Correct Answer: 2

Which of these classes are used by character streams for input and output operations?





✅ Correct Answer: 1

Which of these class is used to read from byte array?





✅ Correct Answer: 3

Which exception is thrown by read() method?





✅ Correct Answer: 4

Which of these is used to read a string from the input stream?





✅ Correct Answer: 1

Which of these class is used to read characters and strings in Java from console?





✅ Correct Answer: 2

Which of these classes are used by Byte streams for input and output operation?





✅ Correct Answer: 1

Which of these class is implemented by FilterInputStream class?





✅ Correct Answer: 2

Which of these class contains the methods print() & println()?





✅ Correct Answer: 3

Which of these methods can be used to writing console output?





✅ Correct Answer: 4

Which of these class is used to create an object whose character sequence is mutable?





✅ Correct Answer: 1

Which of these method of class StringBuffer is used to reverse sequence of characters?





✅ Correct Answer: 3

Which of these classes are used by character streams output operations?





✅ Correct Answer: 1

Which of the following statement is correct?





✅ Correct Answer: 4

Which of these packages contain classes and interfaces used for input & output operations of a program





✅ Correct Answer: 1

Which of these class is not a member class of java.io package?





✅ Correct Answer: 2

Which of these interface is not a member of java.io package?





✅ Correct Answer: 1

Which of these class is not related to input and output stream in terms of functioning?





✅ Correct Answer: 1

Which of these is specified by a File object?





✅ Correct Answer: 2

Which of these is method for testing whether the specified element is a file or a directory?





✅ Correct Answer: 4

Which of these classes is used for input and output operation when working with bytes?





✅ Correct Answer: 2

Which of these class is used to read and write bytes in a file?





✅ Correct Answer: 2

Which of these method of InputStream is used to read integer representation of next available byte input?





✅ Correct Answer: 2

Which of these data type is returned by every method of OutputStream?





✅ Correct Answer: 4

Which of these is a method to clear all the data present in output buffers?





✅ Correct Answer: 1

Which of these is method is used for writing bytes to an outputstream?





✅ Correct Answer: 1

Which of these stream contains the classes which can work on character stream?





✅ Correct Answer: 1

Which of these class is used to read characters in a file?





✅ Correct Answer: 2

Which of these method of FileReader class is used to read characters from a file?





✅ Correct Answer: 3

Which of these class can be used to implement input stream that uses a character array as the source?





✅ Correct Answer: 2

Which of these is a method to clear all the data present in output buffers?





✅ Correct Answer: 4

Which of these classes can return more than one character to be returned to input stream?





✅ Correct Answer: 1

Which of these standard collection classes implements a dynamic array?





✅ Correct Answer: 1