Answer Key (11) - 44 Que
Answer Key (11) - 44 Que
Answer Key (11) - 44 Que
Textbook Exercise
(7) By using which method of file output stream classes writes b length bytes form the
specified byte array in Java ?
(A) void write (int b) (B) void write (byte [] b)
(C) void write (int length) (D) void write (byte length)
(8) Which of the following refers to a collection of data stored on a non-volatile device in a
Computer system?
(A) File (B) Application (C) Volatile data (D) Hard disk
(9) Which method of scanner class of Java, scans the next token of the input as line?
(A) Boolean has Next() (B) int nextInt()
(C) Float next float() (D) string nextline()
(10) Which work can be done in file or directory in Java file class?
(A) Create (B) Rename (C) Delete (D) All of these
(11) Which stream is used to make text files and program codes in Java?
(A) byte stream (B) binary stream (C) character stream (D) input stream
Page 1
(12) By which method of file class in Java returns true if the directory exists, otherwise returns
false?
(A) boolean exists() (B) booleanisFile()
(C) booleanisDirectory() (D) String[]list()
12 (Science) | March – 2015
(13) Which file class method is used to return the number of bytes in that file?
(A) long byte () (B) long file () (C) long number () (D) long length ()
(14) Which class is the base for writing a character stream?
(A) Impress (B) Writer (C) Calc (D) Draw
(15) What occurs when there is a failed I/O operation in writer class?
(A) IO Base (B) IO throw (C) IO Class (D) IO Exception
(16) Which abstract class defines the functionality that is available for all character input
stream?
(A) Text class (B) Void class (C) Reader class (D) Writer class
(17) Which File Input Stream method is used to read a byte of data from this input stream?
(A) void read( ) (B) read void( ) (C) void close( ) (D) int read( )
(18) Which type of storage values store in variables are lost when computer is shutdown?
(A) Voltage storage (B) Non-voltage storage (C) Volatile storage (D) Non-volatile storage
(19) Which class provides a method for reading password?
(A) Write class (B) Scanner Input class (C) Reader class (D) Console class
(20) Which scanner class method is used to scan the next token of the input as “Int”?
(A) int next Int( ) (B) int has Next( ) (C) void int( ) (D) int next( )
(21) Which file class method is used to return the path to the file or directory?
(A) String get Name( ) (B) String get File( )
(C) String get Directory( ) (D) String get Path( )
(22) Data stored in files is often called as what?
(A) Persistent data (B) Personal data (C) Provision data (D) Public data
(23) Which of the following is an example of binary file?
(A) C (B) mp3 (C) txt (D) java
(24) Which class encapsulates information about the properties of a file or a directory?
(A) java.out.file (B) java.in.file (C) java.file.io (D) java.io.File
(25) Which file class method is used to return true, if the file or directory is hidden?
(A) boolean is Hidden( ) (B) boolean exists( )
(C) boolean is File( ) (D) boolean is Directory( )
12 (General) | March – 2016
(26) Storage device of a computer system can be broadly classified into which categories?
(A) Volatile storage (B) Non-volatile storage
(C) Both (A) and (B) (D) Binary storage
(27) From the following which is not binary file extension?
(A) .jpeg (B) .mp3 (C) .class (D) .txt
(28) Which method of file class returns true value if the file or directory is hidden in Java?
(A) boolean is Hidden() (B) boolean is File()
(C) long length() (D) boolean exists()
(29) When we write data to stream, which type of stream is known in Java?
(A) Writer stream (B) Output stream (C) Input stream (D) Reader stream
Page 2
(30) Character stream is classified into how many classes?
(A) 1 (B) 2 (C) 3 (D) 4
(31) The data hierarchy occurs in which of the following order from the smallest to largest
piece of data?
(A) file : character : record : field (B) file : character : field : record
(C) character : field : file ; record (D) character : field : record : file
12 (Science) | March – 2016
(32) Storage device of computer system can be broadly classified into which of the following
category?
(A) Volatile storage (B) Non-volatile storage
(C) Both (A) and (B) (D) Dynamic storage
(33) File can exists on which of the following permanent storage device?
(A) Hard disk (B) Compact disc (C) Optical disc (D) All of these
(34) Which of the following extension is used for binary files?
(A) .jpeg (B) .mp3 (C) .class (D) All of these
(35) In Java, which class encapsulates information about the properties of a file or a directory?
(A) java.io.object.File (B) java.lang.File
(C) java.util.File (D) java.io.File
(36) In Java, which method of file class returns true if file exists, otherwise returns false?
(A) boolean FileDir() (B) boolean isFile()
(C) boolean listFile() (D) boolean getFile()
(37) Java supports which type of streams?
(A) Byte stream (B) Character stream (C) Both (A) and (B) (D) Binary stream
Page 3