What is Collection in Java?
1.A group of classes
2.A group of objects
3.A group of interfaces
4.None
Which exception is thrown by read() method?
1.SystemInputException
2.SystemException
3.InterruptedException
4.IOException
Which of the following statement is correct?
1.replace() method replaces last occurrence of a character in invoking string with another character.
2.replace() method replaces first occurrence of a character in invoking string with another character.
3.reverseall() method reverses all characters.
4.reverse() method reverses all characters.
Which of these class can be used to implement input stream that uses a character array as the source?
1.FileReader
2.CharArrayReader
3.BufferedReader
4.FileArrayReader
Which of these class contains the methods print() & println()?
1.System.out
2.System
3.PrintStream
4.BUfferedOutputStream
Which of these class is implemented by FilterInputStream class?
1.BufferedInputStream
2.FileInputStream
3.BufferedFileInputStream
4.InputStream
Which of these class is not a member class of java.io package?
1.Writer
2.String
3.File
4.StringReader
Which of these class is not related to input and output stream in terms of functioning?
1.File
2.Writer
3.Reader
4.InputStream
Which of these class is used to create an object whose character sequence is mutable?
1.StringBuffer()
2.String()
3.Both of the mentioned
4.None
Which of these class is used to read and write bytes in a file?
1.InputStreamReader
2.FileInputStream
3.FileWriter
4.FileReader
Which of these class is used to read characters and strings in Java from console?
1.StringReader
2.BufferedReader
3.InputStreamReader
4.BufferedStreamReader
Which of these class is used to read characters in a file?
1.FileWriter
2.FileReader
3.FileInputStream
4.InputStreamReader
Which of these class is used to read from byte array?
1.BufferedInputStream
2.ArrayInputStream
3.ByteArrayInputStream
4.InputStream
Which of these classes are used by Byte streams for input and output operation?
1.InputOutputStream
2.InputStream
3.Reader
4.All of the above
Which of these classes are used by Byte streams for input and output operation?
1.InputStream
2.InputOutputStream
3.Reader
4.All of the above
Which of these classes are used by character streams for input and output operations?
1.Writer
2.InputStream
3.InputOutputStream
4.ReadStream
Which of these classes are used by character streams output operations?
1.Writer
2.InputStream
3.ReadStream
4.InputOutputStream
Which of these classes can return more than one character to be returned to input stream?
1.PushbachReader
2.BufferedReader
3.CharArrayReader
4.Bufferedwriter
Which of these classes is not part of Java's collection framework?
1.Stack
2.Queue
3.Array
4.Maps
Which of these classes is used for input and output operation when working with bytes?
1.Reader
2.InputStream
3.Writer
4.All of the above
Which of these data type is returned by every method of OutputStream?
1.float
2.int
3.byte
4.None of these
Which of these interface declares core method that all collections will have?
1.Comparator
2.Collection
3.EventListner
4.set
Which of these interface handle sequences?
1.List
2.Set
3.Collection
4.Comparator
Which of these interface is not a member of java.io package?
1.ObjectFilter
2.DataInput
3.FileFilter
4.ObjectInput
Which of these interface is not a part of Java's collection framework?
1.Set
2.List
3.SortedList
4.SortedMap
Which of these interface is not a part of Java's collection framework?
1.Set
2.List
3.SortedList
4.SortedMap
Which of these interface must contain a unique element?
1.Set
2.List
3.Collection
4.Array
Which of these is a method to clear all the data present in output buffers?
1.flush()
2.clear()
3.close()
4.fflush()
Which of these is a method to clear all the data present in output buffers?
1.close()
2.clear()
3.fflush()
4.flush()
Which of these is a type of stream in Java?
1.Short stream
2.Integer stream
3.Long stream
4.Byte stream
Which of these is an incorrect form of using method max() to obtain maximum element?
1.max(Collection c)
2.max(Comparator comp)
3.max(List c)
4.max(Collection c, Comparator comp)
Which of these is Basic interface that all other interface inherits?
1.Array
2.Set
3.Collection
4.List
Which of these is method for testing whether the specified element is a file or a directory?
1.Isfile()
2.isfile()
3.IsFile()
4.isFile()
Which of these is method is used for writing bytes to an outputstream?
1.print()
2.put()
3.printf()
4.write()
Which of these is specified by a File object?
1.directory path
2.directory in disk
3.a file in disk
4.None
Which of these is static variable defined in Collections?
1.EMPTY_SET
2.EMPTY_LIST
3.EMPTY_MAP
4.All of the above
Which of these is true about unmodifiableCollection() method?
1.unmodifiableCollection() method is available only for List and Set.
2.unmodifiableCollection() returns a collection that cannot be modified.
3.unmodifiableCollection() is defined in Collection class.
4.None
Which of these is used to perform all input & output operations in Java?
1.classes
2.Variables
3.streams
4.Methods
Which of these is used to read a string from the input stream?
1.readLine()
2.get()
3.getLine()
4.read()
Which of these method of class StringBuffer is used to reverse sequence of characters?
1.reverseall()
2.Reverse()
3.reverse()
4.reverseAll()
Which of these method of FileReader class is used to read characters from a file?
1.get()
2.scanf()
3.read()
4.getInteger()
Which of these method of InputStream is used to read integer representation of next available byte input?
1.scanf()
2.read()
3.get()
4.getInteger()
Which of these methods can be used to writing console output?
1.print()
2.println()
3.write()
4.All of the above
Which of these methods can convert an object into a List?
1.ConvertList()
2.singletonList()
3.CopyList()
4.SetList()
Which of these methods can randomize all elements in a list?
1.randomize()
2.ambigous()
3.rand()
4.shuffle()
Which of these methods deletes all the elements from invoking collection?
1.delete()
2.refresh()
3.reset()
4.clear()
Which of these methods sets every element of a List to a specified object?
1.fill()
2.set()
3.add()
4.Complete()
Which of these packages contain classes and interfaces used for input & output operations of a program
1.java.io
2.java.util
3.java.lang
4.All of the above
Which of these standard collection classes implements a dynamic array?
1.ArrayList
2.LinkedList
3.AbstractSet
4.AbstractList
Which of these stream contains the classes which can work on character stream?
1.Character Stream
2.InputStream
3.OutputStream
4.All of the above