Home / HSC(ENG) - GSEB Board / Reading Mode

๐Ÿ“– Reading Mode: HSC(ENG) - GSEB Board

Chapter: File handling โ€ข Total: 257 MCQs

MCQ 1 Stream Classes in Java

which class has a special feature that is breaks the input string into tokens using a delimiter ?

A scaner
B date
C calander
D stream
MCQ 2 Character Stream Classes

For character stream classes,which packageย is available for a group of classes ?

A java.util
B java.io
C java.lang
D java.util.Arrays
MCQ 3 Console Class

Which class can be used to get input from the keyboard and the input is to be typed in hidden form ?

A Scanner
B Console
C Stream
D Date
MCQ 4 Scanner Class

Which of the following method does not belong ย to scanner class?

A String nextLine ()
B int nextInt()
C float nextFloat ()
D int read()
MCQ 5 Methods of File Class

In file class of java, which method is used to return the name of file and directory in a directory?

A String getName ()
B String getPath ()
C String ย []list ()
D String getAbsolutePath ()
MCQ 6 Stream Classes in Java

FROM THE FOLLOWING WHICH ARE THE TYPES OF STREAM CLASS IN JAVA.

A Character Stream
B Byte Steam
C Both a and b
D Boolean Stream
MCQ 7 Understanding Computer Files

FROM THE FOLLOWING WHICH EXTENSION ARE USED TO INDICATE TEXT FILES.

A .C
B .TXT
C .JAVA
D ALL OF THESE
MCQ 8 Methods of File Class

FILE METHOD BOOLEN IS FILE() RETURNS WHICH TYPE OF VALUE OF FILE CLASS?

A TRUE OR FALSE
B YES OR NO
C 0 OR 1
D Y OR N
MCQ 9 Introduction to Streams

WHICH OF THE FOLLOWING IS TRUE ABOUT STREAMS IN JAVA?

A STREMS ALWAYS
B STREMS ARE CHANLES
C ONLY ONE STREAM
D ALL OF THESE
MCQ 10 Scanner Class

WHICH OF THE FOLLOWING IS USED AS A SEPARATOR BETWEEN FIELDS OF RECORD?

A VARIABLE
B SPACE
C PATH
D DELIMITER
MCQ 11 Understanding Computer Files

WHICH STORAGE IS PERMANANET STORAGE DATA IS NOT LOST WHEN A COMPUTER LOSES POWER?

A VOLATILE STORGAE
B NON-VOLATILE
C BOTH (A) & (B)
D OBJECT DATA
MCQ 12 Understanding Computer Files

Scanner class can be used for performing which of the following operations?

A Accept input from the keyboard
B Read from the file
C parse a string separated by delimiters
D All of the above
MCQ 13 Understanding Computer Files

Storage devices of a computer system can be broadly classified into how many categories?

A volatile storage
B non- volatile Storage
C Access storage
D Both a and b
MCQ 14 Understanding Computer Files

Which of the following storage is temporary storage in computer system?

A Volatile storage
B non- volatile Storage
C Access storage
D Both a and b
MCQ 15 Understanding Computer Files

What do we call the storage where values stored in variables are lost when a computer is shutdown?

A Volatile storage
B Non- volatile
C Access storage
D Both a and b
MCQ 16 Understanding Computer Files

Which of the following storage is permanent storage in computer system?

A Volatile storage
B Non- volatile Storage
C Access storage
D Both a and b
MCQ 17 Understanding Computer Files

What do we call the storage where data is not lost when a computer loses power?

A Volatile storage
B Non- volatile
C Access storage
D Both a and b
MCQ 18 Understanding Computer Files

Which of the following are the examples of Non- volatile or permanent storage device?

A Hard disk, USB drive
B Optical disk
C CD
D All of these
MCQ 19 Understanding Computer Files

File can be broadly classified into how many categories in Java?

A Text file
B binary file
C Image file
D both a and b
MCQ 20 Understanding Computer Files

Which file contains data that can be read in a text editor?

A Text file
B binary file
C Image file
D both a and b
MCQ 21 Understanding Computer Files

Name the schemes which are used to enclosed the text file?

A ASCII
B Unicode
C True font
D both a and b
MCQ 22 Understanding Computer Files

Which file can be data file that contains facts such as a payroll file that contain employeenumber, name and salary? (some text file can be program files or application files that store software instructions)

A Text file
B binary file
C Image file
D both a and b
MCQ 23 Understanding Computer Files

Which of the following are the examples of text editor?

A Gedit
B vi, pico
C Scite
D All of these
MCQ 24 Understanding Computer Files

Write down some common extensions of text file.

A .txt
B .java
C .c
D All of these
MCQ 25 Understanding Computer Files

The contents of a Binary files are in โ€ฆโ€ฆโ€ฆโ€ฆโ€ฆformat.

A text
B binary
C image
D video
MCQ 26 Understanding Computer Files

Which type of file contains data that has not been encoded as text?

A Text file
B Binary file
C Image file
D Video file
MCQ 27 Understanding Computer Files

What is the meaning of binary format?

A The data is accessed in term of bytes.
B The data is accessed in term of bits.
C The data is unaccessed in term of bytes.
D The data is accessed in terms of bite code.
MCQ 28 Understanding Computer Files

Which of the following are the common extensions of binary file?

A .jpeg,
B .mp3
C .class
D All of these
MCQ 29 Understanding Computer Files

Java provides โ€ฆโ€ฆโ€ฆโ€ฆclasses that contain methods to help us with particular tasks.

A user define
B built โ€“ in
C default
D prepackage
MCQ 30 Understanding Computer Files

Classes are present in โ€ฆโ€ฆโ€ฆโ€ฆโ€ฆ.package.

A java.io
B java.util
C java.lang
D java.util.io
MCQ 31 Understanding Computer Files

Java uses the concepts of โ€ฆโ€ฆโ€ฆ.which provides two different categories of java classes to perform I/O operations on bytes and characters.

A streams
B reader
C writer
D binary
MCQ 32 Understanding Computer Files

Which of the following class encapsulates information about the properties of a file or a directory?

A java.io.File
B java.io.file
C java.file
D java.util.File
MCQ 33 Understanding Computer Files

Which of the following class can be used to access attributes of files and directories?

A file
B directory
C read
D write
MCQ 34 Understanding Computer Files

Which operations can be done on a file or a directory?

A create
B rename
C delete
D All of these
MCQ 35 Understanding Computer Files

Write down some file attributes in java.

A File permission
B length of a file
C last or modification file time
D All of these
MCQ 36 Understanding Computer Files

There are โ€ฆโ€ฆโ€ฆโ€ฆโ€ฆmethods of โ€œfile classโ€ that can be used to perform various operations on a file or directory.

A 10
B 20
C 30
D 40
MCQ 37 Understanding Computer Files

How many ways to provide file reference to the File Class?

A 2
B 3
C 4
D 5
MCQ 38 Understanding Computer Files

Which of the following way to provide file reference to the File Class?

A absolute path
B relative path in string format
C directory
D both a and b
MCQ 39 Understanding Computer Files

In Linux. "passwdโ€Ÿ file present in which directory?

A etc
B in
C root
D pwd
MCQ 40 Understanding Computer Files

Which method of File Class returns true if the file or directory exists, otherwise returns false?

A boolean isFile( )
B boolean exists( )
C boolean File()
D Boolean isDir( )
MCQ 41 Understanding Computer Files

Which method of File Class returns the name of the file or directory referred by the object?

A String getPath( )
B String getName( )
C String( )
D String setName()
MCQ 42 Understanding Computer Files

Which method of File Class returns the number of bytes in that file?

A long length( )
B String length( )
C length( )
D Str length( )
MCQ 43 Understanding Computer Files

Which method of File Class returns the name of file and directories in a directory?

A String[ ] list( )
B long length( )
C list( )
D List[ ] String( )
MCQ 44 Understanding Computer Files

Which method of File Class returns an array of abstract path names denoting the file in the directory?

A String[ ] File( )
B File[ ] listFiles( )
C File list( )
D ListFile( )
MCQ 45 Understanding Computer Files

Which method of File Class is used to list all the files present in that directory?

A length( )
B list( )
C ls( )
D ls Length( )
MCQ 46 Understanding Computer Files

Java uses โ€ฆโ€ฆโ€ฆโ€ฆ..classes to carry out read and write operations on files.

A Stream
B Binary
C File
D Directory
MCQ 47 Understanding Computer Files

A โ€ฆโ€ฆ.. is an abstract representation of an input or output device that is used as a source or destination for data.

A Stream
B Binary
C File
D Directory
MCQ 48 Understanding Computer Files

We can visualize a โ€ฆโ€ฆโ€ฆโ€ฆโ€ฆโ€ฆ.as a sequence of bytes.

A Stream
B Binary
C File
D Directory
MCQ 49 Understanding Computer Files

We can โ€ฆโ€ฆโ€ฆโ€ฆโ€ฆdata using streams.

A write
B read
C delete
D Both a or b
MCQ 50 Understanding Computer Files

When we write data to stream, the stream is called an โ€ฆโ€ฆโ€ฆโ€ฆ..stream.

A output
B input
C file
D dir
MCQ 51 Understanding Computer Files

The output stream can transfer data from the program to a โ€ฆโ€ฆโ€ฆโ€ฆโ€ฆ..

A file
B Directory
C root
D etc
MCQ 52 Understanding Computer Files

An โ€ฆโ€ฆโ€ฆโ€ฆ.stream is used to read data from an external device to the program.

A output
B input
C file
D dir
MCQ 53 Understanding Computer Files

Which of the following stream can transfer data from keyboard or from the file on a hard disk to the program?

A input stream
B output stream
C file stream
D directory stream
MCQ 54 Understanding Computer Files

A character is generally stored using which of the following format?

A ASCII
B Unicode
C TRUE
D Both a and b
MCQ 55 Understanding Computer Files

When character is used for calculation purpose; its โ€ฆโ€ฆโ€ฆโ€ฆโ€ฆ..value is meaningful.

A binary
B decimal
C Octal
D Hexadecimal
MCQ 56 Understanding Computer Files

If we want to store the statement โ€œHuman beings have 32 teeth.โ€, when which representation is advisable?

A Binary
B Character
C ASCII
D Unicode
MCQ 57 Understanding Computer Files

To apply numerical calculation, we use data types like int, float or double that allows us to store the numbers in โ€ฆโ€ฆโ€ฆโ€ฆ..format.

A Binary
B Character
C ASCII
D Unicode
MCQ 58 Understanding Computer Files

Java supports โ€ฆโ€ฆโ€ฆโ€ฆโ€ฆ.types of streams.

A byte stream
B character stream
C bitecode
D both a and b
MCQ 59 Understanding Computer Files

What do we call the streams that transfer data in the form of bytes to the file or devices?

A byte stream or binary stream
B Character stream
C Bite code stream
D None
MCQ 60 Understanding Computer Files

What do we call the files that are created using byte stream?

A Object file
B Binary file
C Byte file
D Directory
MCQ 61 Understanding Computer Files

Binary files can also be used to storeโ€ฆโ€ฆโ€ฆโ€ฆโ€ฆโ€ฆ.

A arrays
B object
C Function
D Both a or b
MCQ 62 Understanding Computer Files

Text files and program codes are created using which type of stream?

A byte or binary stream
B Character stream
C bite code stream
D None
MCQ 63 Understanding Computer Files

Text files can be opened inโ€ฆโ€ฆโ€ฆโ€ฆsoftware. Like vi or SciTE

A text editor
B word processor
C browser
D presentation
MCQ 64 Understanding Computer Files

Stream classes are presents in which package?

A java.io
B java.util
C java.util.io
D java *.io
MCQ 65 Understanding Computer Files

Character stream classes deal with which of the following data?

A character
B text
C number
D both a or b
MCQ 66 Understanding Computer Files

Byte stream classes deal with which of the following data?

A binary
B character
C text
D number
MCQ 67 Understanding Computer Files

An โ€ฆโ€ฆโ€ฆโ€ฆโ€ฆ..stream reads data from the source (file, keyboard).

A input
B output
C file
D Directory
MCQ 68 Understanding Computer Files

An โ€ฆโ€ฆโ€ฆโ€ฆโ€ฆ. stream writes data to the destination (file, output device).

A input
B output
C file
D Directory
MCQ 69 Understanding Computer Files

The java.io package contains a collection of stream classes that support ..โ€ฆโ€ฆโ€ฆin a file.

A reading
B writing
C executive
D both a and b
MCQ 70 Understanding Computer Files

To use reading or writing classes, which package do we need to import in our program?

A java.io
B java.util
C java.lang
D java.*.lang
MCQ 71 Understanding Computer Files

Java streams can be classified into which of the following basic types?

A input stream
B output stream
C bit stream
D character stream
MCQ 72 Understanding Computer Files

Character stream classes can be used to read and write how many bit Unicode character?

A 16
B 32
C 8
D 4
MCQ 73 Understanding Computer Files

Which class is a group of classes designed to read characters from files?

A Writer Class
B Reader class
C read class
D write class
MCQ 74 Understanding Computer Files

Which class is a group of classes designed to write characters into a file?

A Writer Class
B Reader class
C read class
D write class
MCQ 75 Understanding Computer Files

The java.io.Reader class and java.io.Writer class are inherited from the โ€ฆโ€ฆโ€ฆโ€ฆclass.

A object
B file
C Directory
D Variable
MCQ 76 Understanding Computer Files

InputStreamReader and BufferReader are the subclass of โ€ฆโ€ฆโ€ฆโ€ฆโ€ฆ..class.

A Writer
B Reader
C Object
D File
MCQ 77 Understanding Computer Files

OutputStreamWriter, BufferWriter and PrintWriter are the subclasses of โ€ฆโ€ฆโ€ฆโ€ฆโ€ฆ.class.

A Writer
B Reader
C Object
D File
MCQ 78 Understanding Computer Files

A detail description of methods, constructor can be obtained from online Java documentation from โ€ฆโ€ฆโ€ฆโ€ฆโ€ฆโ€ฆURL address.

A http:// docs.oracle.com/javase/6/docs/api/
B http://docs.oracle/java
C http://javac
D http://docs/javase/api
MCQ 79 Understanding Computer Files

The method of Writer class can throw which of the following exception?

A IOException
B ArithmeticException
C langException
D utilException
MCQ 80 Understanding Computer Files

The OutputStreamWriter class converts stream of characters to a stream of โ€ฆโ€ฆโ€ฆโ€ฆ..

A Bytes
B Bits
C points
D Pixels
MCQ 81 Understanding Computer Files

What is the meaning of filepath parameter in statement โ€œFileWriter(String filepath);โ€?

A is the full path name of a file
B Directory path name
C Subdirectory full path name
D subfile path name
MCQ 82 Understanding Computer Files

What is the meaning of fileobj in statement โ€œFileWriter(File fileobj);โ€?

A Is a file object that describe the file
B is a file object that describe directory
C is a directory that describe the directory
D is a directory that describe file.
MCQ 83 Understanding Computer Files

What happens if append is true in statement "FileWriter (Sting filepath, boolean append);โ€?

A Characters are append to the end of file.
B Characters are append to the start of file.
C files are append to the end of directory.
D None
MCQ 84 Understanding Computer Files

What happens if append is false in statement "FileWriter (Sting filepath, boolean append);โ€?

A The existing contents of the file are overwritten
B The existing contents of the file are same
C The new contents of the file are append to the end of file.
D None
MCQ 85 Understanding Computer Files

Which of the right syntax to create an object of FileWriter class?

A FileWriter fwobj=new FileWriter("/java/files/one.txtโ€);
B Writer fwobj=new Writer("/java/files/one.txtโ€);
C FileWriter fwobj=new Writer("/java/files/one.txtโ€);
D FileWriter fwobj=FileWriter("/java/files/one.txtโ€);
MCQ 86 Understanding Computer Files

It is important to close the โ€ฆโ€ฆโ€ฆโ€ฆ..object after writing to a file is accomplished.

A stream
B File
C Directory
D Variable
MCQ 87 Understanding Computer Files

Reader class converts a stream of bytes to a stream ofโ€ฆโ€ฆโ€ฆโ€ฆ.

A characters
B Bytes
C Bits
D File
MCQ 88 Understanding Computer Files

Which of the following is the correct syntax to create an object of FileReader class.

A FileReader frobject=new FileReader('/java/files/one.txtโ€);
B Reader frobject=new Reader('/java/files/one.txtโ€);
C FileReader frobject= FileReader('/java/files/one.txtโ€);
D File frobject=new FileReader('/java/files/one.txtโ€);
MCQ 89 Understanding Computer Files

FileOutputStream class throws which type of Exception?

A FileNotFoundException
B IO Exception
C Arithmetic Exception
D FileFound Exception
MCQ 90 Understanding Computer Files

In Java โ€ฆโ€ฆโ€ฆโ€ฆ.is applied to convert integer to character after read operation is performed.

A typecasting
B condition
C methods
D conversion
MCQ 91 Understanding Computer Files

โ€ฆโ€ฆโ€ฆโ€ฆโ€ฆclass belongs to the java.util package.

A Scanner
B reader
C writer
D Array
MCQ 92 Understanding Computer Files

A special feature of scanner class is that it breaks the input string into โ€ฆโ€ฆusing a delimiter.

A tokens (words)
B number
C keywords
D Methods
MCQ 93 Understanding Computer Files

A scanner object can be created from a โ€ฆโ€ฆโ€ฆโ€ฆโ€ฆโ€ฆโ€ฆโ€ฆ.objects.

A string
B file object
C InputStream
D All of above
MCQ 94 Understanding Computer Files

The numbers are scanned as integer numbers using the โ€ฆโ€ฆโ€ฆ..method of the Scanner class.

A nextInt( )
B nextint( )
C NextInt( )
D Intnext( )
MCQ 95 Understanding Computer Files

Apart from Scanner class which is the another class which can be used to get the input from the keyboard?

A Reader class
B java.io.Console class
C java.io.console class
D Writer
MCQ 96 Understanding Computer Files

Which class can be used when the input is to be typed in hidden form?

A Console class
B Scanner class
C Reader
D Writer
MCQ 97 Understanding Computer Files

The โ€ฆโ€ฆโ€ฆโ€ฆโ€ฆ..class provides a method for reading password.

A Console class
B Scanner class
C Reader
D Writer
MCQ 98 Understanding Computer Files

When reading the password the user input will be hidden or not shown in the โ€ฆโ€ฆโ€ฆ screen.

A Console
B Scanner
C Reader
D Writer
MCQ 99 Understanding Computer Files

Console class will return an โ€ฆโ€ฆโ€ฆโ€ฆ of character as the return type.

A Array
B Object
C Variable
D Method
MCQ 100 Understanding Computer Files

The Console class belongs to โ€ฆโ€ฆโ€ฆโ€ฆโ€ฆโ€ฆpackage.

A java.io
B java.util
C java.lang
D java.Arrays
MCQ 101 Understanding Computer Files

Which method is used to write few lines into the file?

A write( )
B read( )
C Writer( )
D Reader( )
MCQ 102 Understanding Computer Files

Which method is used to read few lines from the file?

A write( )
B read( )
C Writer( )
D Reader( )
MCQ 103 Understanding Computer Files

Which method is used for closing a file after addition (modification)?

A close( )
B quit( )
C Exit( )
D q( )
MCQ 104 Understanding Computer Files

Which of the following class provides various methods to read input from file or keyboard?

A Scanner
B Reader
C Writer
D Stream
MCQ 105 Understanding Computer Files

In Java, Which of the following class returns the name of files and directories in a directory?

A String[] list( )
B Boolean isFile( )
C String getName( )
D String getPath( )
MCQ 106 Understanding Computer Files

In Java, which method of Scanner class returns true of there is a token in input?

A String next( )
B Boolean hasNext( )
C int nextInt( )
D String nextLine( )
MCQ 107 Understanding Computer Files

In Java, read( ) method of file Reader class returns which value to indicate the end of stream?

A 0
B -1
C 1
D e
MCQ 108 Understanding Computer Files

Which of the following class encapsulates information about the properties of a file or a directory?

A java.io.File
B java.io.FD
C java.io.FileDir
D java.io.Director
MCQ 109 Understanding Computer Files

Which of the following file class method returns true if the file exists, otherwise return false?

A booleangetFile( )
B boolean isFile( )
C Boolean exists( )
D Boolean srcFile( )
MCQ 110 Understanding Computer Files

Scanner class belongs to which of the following package?

A java.io.File
B java.pack
C java.scan
D java.util
MCQ 111 Understanding Computer Files

Which of the following class provides a method for reading password?

A Console class
B File class
C Write class
D Password class
MCQ 112 Understanding Computer Files

Which of the following scanner class method scans the next token of the input as line?

A String nextLine( )
B String next( )
C String close( )
D Void close( )
MCQ 113 Understanding Computer Files

Which of the following is a temporary storage?

A Volate storage
B Non volatile storage
C Volatile storage
D Valid storage
MCQ 114 Understanding Computer Files

In Java, when we write data to stream, what is that stream called?

A data stream
B input stream
C output stream
D line stream
MCQ 115 Understanding Computer Files

In Java, text files and program codes are created using which stream?

A character stream
B binary stream
C byte stream
D Boolean stream
MCQ 116 Understanding Computer Files

In writer class of Java, which of the following exception occurs when there is a failed I/O operation?

A OutputException
B InputException
C FileException
D IOException
MCQ 117 Understanding Computer Files

In Java, FileInputStream and FileOutputStream are classes of which package that gives us the ability to read and write bytes from and into any files in the disk?

A java.file
B java.output
C java.input
D java.io
MCQ 118 Understanding Computer Files

In Java, scanner class can be used to perform which of the following operations?

A Reading password
B Write data into file
C Accept input from the keyboard
D Count number of character in file
MCQ 119 Understanding Computer Files

Storage device of computer system can be broadly classified into which of the following category?

A Volatile storage
B Non-volatile storage
C Dynamic storage
D Both a and b
MCQ 120 Understanding Computer Files

File can exist on which of the following permanent storage device?

A Hard disk
B Compact disc
C Optical disk
D All of above
MCQ 121 Understanding Computer Files

Which of the following extension is used for binary files?

A .jpeg
B .mp3
C .class
D All of above
MCQ 122 Understanding Computer Files

In Java, Which class encapsulates information about the properties of a file or a directory?

A java.util.Dir
B java.lang.Dir
C java.io.File
D java.io.object.Fd
MCQ 123 Understanding Computer Files

In Java, Which method of file class returns true if file exists, otherwise returns false?

A boolean isFile( )
B Boolean listFile( )
C Boolean getFname( )
D Boolean file()
MCQ 124 Understanding Computer Files

Java supports which of the stream?

A Byte stream
B Character stream
C Both a and b
D Binary stream
MCQ 125 Understanding Computer Files

In Java, which of the following is a subclass of Reader class?

A InputstreamReader
B BufferedReader
C OutputStream
D Both a and b
MCQ 126 Understanding Computer Files

In Java, read( ) method returns what to identify the end of data in the stream?

A 1
B -1
C 0
D End
MCQ 127 Understanding Computer Files

In Java, which method of console class reads a single line of text from the console?

A Char Print( )
B Char getLine()
C String readLine( )
D String PrintLine( )
MCQ 128 Understanding Computer Files

Which of the following refers to a collection of data stored on a nonvolatile device in a computer system?

A Hard disk
B volatile data
C Application
D File
MCQ 129 Understanding Computer Files

Which class provides a method for reading password?

A Console class
B Writer class
C Scanner Input class
D Reader class
MCQ 130 Understanding Computer Files

Which scanner class method is used to scan the next token of the input as Int?

A int text( )
B int nextInt( )
C int has Next( )
D void int( )
MCQ 131 Understanding Computer Files

Which file class method is used to return the path to the file or directory?

A String getPath( )
B String get Name( )
C String get File( )
D String get Directory( )
MCQ 132 Understanding Computer Files

In Java, which method of file writer class writes the lower 16 bits of โ€˜cโ€™ to the stream?

A void write (int c)
B void write (string s)
C boolean write (int c)
D string (write (int c)
MCQ 133 Understanding Computer Files

In Java, which of the following classes can be used to get the input from the keyboard, when input to be typed in hidden form?

A java.util. Scanner
B java.util.Console
C java.io.Console
D java.io.File Reader
MCQ 134 Understanding Computer Files

In Java, which method of scanner class, scans the next token of the input as Line?

A string next( )
B boolean hasNext ( )
C int next Line ( )
D string nextLine ( )
MCQ 135 Understanding Computer Files

Which class of Java can be used to access attributes of files like file permissions, length of a file, last modification time?

A Writer Class
B File Class
C Scanner Class
D Console Class
MCQ 136 Understanding Computer Files

In Java, which kind of files contain data that can be read in a text editor because the data has been encoded using a scheme such as ASCII or Unicode?

A Text files
B Binary files
C Image files
D Audio files
MCQ 137 Understanding Computer Files

In Java, which method of file class returns an array of abstract path names denoting the files in the directory?

A String[ ] list( )
B long length( )
C File [ ] listFiles ( )
D string getPath( )
MCQ 138 Stream Classes in Java

Which class defines the functionality that is available for all character input streams?

A void reader class
B Exact reader class
C Abstract reader class
D Super reader class
MCQ 139 Character Stream Classes

Which of the following format is used in Java to store a character?

A ASCII
B Unicode
C Both (A) and (B)
D None of these
MCQ 140 Understanding Computer Files

Which of the following is generally stored in RAM (Random Access Memory)?

A Variables
B Object
C Both A and B
D None of the given
MCQ 141 Understanding Computer Files

The file representing the data in the form of bytes is known as _____________

A Binary file
B Text file
C Application file
D All of the given
MCQ 142 Understanding Computer Files

The ____________________ is used to read bytes data from the file in Java

A FileWriteStream
B FileOutputStream
C FileInputStream
D All of the given
MCQ 143 Understanding Computer Files

Which method of console class reads a single line of text from a console?

A Char[] readPassword
B String readLine()
C Char[] readLine
D All of the given
MCQ 144 Understanding Computer Files

Scanner class provides various methods to read input from ___________

A keyboard
B file
C Both A and B
D None of the given
MCQ 145 Understanding Computer Files

The _____class extends the writer class and converts stream of characters to a stream of bytes.

A OutputStreamWriter
B FileWriter
C InputStreamReader
D FileReader
MCQ 146 Understanding Computer Files

The data in volatile storage is lost when ____________________

A the file is saved
B the file is closed
C the computer starts
D when a computer is shutdown
MCQ 147 Understanding Computer Files

Which value is returned by boolean isFile() method of file class?

A 0 or 1
B true or false
C Yes or No
D None of the given
MCQ 148 Understanding Computer Files

__________________ class in Java is used to write bytes to the file or some output stream.

A FileReadStream
B FileOutputStream
C FileInputStream
D All of the given
MCQ 149 Understanding Computer Files

Which method of console class is used to read password or passphrase from the console?

A Char[] readPassword
B String readPassword
C Console readPassword
D All of the given
MCQ 150 Understanding Computer Files

Binary files can be used to store ____________

A arrays
B objects
C A or B
D program code
MCQ 151 Understanding Computer Files

____________________ method of scanner class scans the next token of the input as Int.

A int nextInt()
B boolean hasNext()
C string next()
D string nextLine()
MCQ 152 Understanding Computer Files

In which of the following data is not lost when a computer loses power?

A Volatile storage
B Non-volatile storage
C Both A and B
D None of the given
MCQ 153 Understanding Computer Files

Which method of the file class returns true if the file/directory exists else returns false?

A boolean isFile()
B boolean isDir()
C boolean isDirectory()
D boolean exists()
MCQ 154 Understanding Computer Files

Which package is used to perform various operations on characters in Java?

A Java.process
B java.file
C Java.object
D java.io
MCQ 155 Understanding Computer Files

Which class in Java program is used to read username and password?

A scanner
B user
C console
D stream
MCQ 156 Understanding Computer Files

_____________ is/are created using character stream.

A Text file
B Program code
C Both A and B
D Array
MCQ 157 Understanding Computer Files

_____________ method of reader class reads next available character from the stream. It returns "-1" to indicate the end of stream.

A void close( )
B int read( )
C int read(-1)
D Both B and C
MCQ 158 Understanding Computer Files

Which of the following is used to encode data of text file?

A ASCII
B UNICODE
C A or B
D None of the given
MCQ 159 Understanding Computer Files

Which method of file class returns true if the file or directory is hidden?

A boolean isFile( )
B boolean isfile( )
C boolean isHidden( )
D boolean exists()
MCQ 160 Understanding Computer Files

________________ method of FileInputStream in the java.io.package closes the file input stream and releases any system resources associated with the stream.

A void free( )
B void close( )
C Both A and B
D None of the given
MCQ 161 Understanding Computer Files

Which class is used especially when the input is to be typed in hidden form?

A Scanner
B Console
C User
D Stream
MCQ 162 Understanding Computer Files

Which exception is thrown by the methods of writer class?

A FileNotFoundexception
B IOException
C ArithmeticException
D Nullpointerexception
MCQ 163 Understanding Computer Files

____________ class breaks the input string into tokens using a delimiter.

A Console
B Scanner
C Writer
D Reader
MCQ 164 Understanding Computer Files

Which of the following file can be a data file?

A Binary
B Text
C Object
D None of the given
MCQ 165 Understanding Computer Files

Which method of file class returns the absolute path of the file or directory?

A String get( )
B String getpath( )
C String path( )
D String getAbsolutepath( )
MCQ 166 Understanding Computer Files

Which method of FileInputStream reads a byte from the input stream?

A int read( )
B int readdata( )
C int readbyte( )
D int write( )
MCQ 167 Understanding Computer Files

By using which class, the characters that are typed are not shown on the screen and remain in the hidden form?

A scanner
B user
C stream
D console
MCQ 168 Understanding Computer Files

Which of the following can be accepted by the constructors of FileOutputStream?

A A string containing the path to the file location
B An object of the file class
C A or B Compiled
D Name of the directory
MCQ 169 Understanding Computer Files

A scanner object can be created from _______________

A a string
B file object
C InputStream object
D A or B or C
MCQ 170 Understanding Computer Files

Which of the following editor is used to create text file?

A Vi
B Pico
C Gedit
D All of the given
MCQ 171 Understanding Computer Files

___________ method of file class returns the name of file or directory referred by the object.

A String get( )
B String getName( )
C String getFile( )
D String Name( )
MCQ 172 Understanding Computer Files

Which of the following is required to create in order to use class and methods of FileOutputStream?

A File object
B Output object
C Output stream
D None of the given
MCQ 173 Understanding Computer Files

Which method of scanner class returns true if there is a token in input?

A string close( )
B void close( )
C Boolean hasNext()
D int next()
MCQ 174 Understanding Computer Files

For which of the following reason/s the constructor of FileOutputStream can throw FileNotFoundException?

A File does not exist.
B If the file name refers to directory rather than a regular file.
C File cannot be opened for some reason.
D A or B or C Compiled
MCQ 175 Understanding Computer Files

_________________ are used to read and write 16-bit unicode characters.

A Character stream classes
B Byte stream classes
C Both A and B
D None of the given
MCQ 176 Stream Classes in Java

which class has a special feature that is breaks the input string into tokens using a delimiter ?

A scaner
B date
C calander
D stream
MCQ 177 Character Stream Classes

For character stream classes,which packageย is available for a group of classes ?

A java.util
B java.io
C java.lang
D java.util.Arrays
MCQ 178 Console Class

Which class can be used to get input from the keyboard and the input is to be typed in hidden form ?

A Scanner
B Console
C Stream
D Date
MCQ 179 Scanner Class

Which of the following method does not belong ย to scanner class?

A String nextLine ()
B int nextInt()
C float nextFloat ()
D int read()
MCQ 180 Methods of File Class

In file class of java, which method is used to return the name of file and directory in a directory?

A String getName ()
B String getPath ()
C String ย []list ()
D String getAbsolutePath ()
MCQ 181 Understanding Computer Files

What do we call the storage where values stored in variables are lost when a computer is shutdown?

A Volatile storage
B Non- volatile
C Access storage
D Both a and b
MCQ 182 Understanding Computer Files

There are โ€ฆโ€ฆโ€ฆโ€ฆโ€ฆmethods of โ€œfile classโ€ that can be used to perform various operations on a file or directory.

A 10
B 20
C 30
D 40
MCQ 183 Understanding Computer Files

In Linux. "passwdโ€Ÿ file present in which directory?

A etc
B in
C root
D pwd
MCQ 184 Understanding Computer Files

A โ€ฆโ€ฆ.. is an abstract representation of an input or output device that is used as a source or destination for data.

A Stream
B Binary
C File
D Directory
MCQ 185 Understanding Computer Files

In Java, which method of file writer class writes the lower 16 bits of โ€˜cโ€™ to the stream?

A void write (int c)
B void write (string s)
C boolean write (int c)
D string (write (int c)
MCQ 186 Understanding Computer Files

In Java, which of the following classes can be used to get the input from the keyboard, when input to be typed in hidden form?

A java.util. Scanner
B java.util.Console
C java.io.Console
D java.io.File Reader
MCQ 187 Understanding Computer Files

In Java, which method of scanner class, scans the next token of the input as Line?

A string next( )
B boolean hasNext ( )
C int next Line ( )
D string nextLine ( )
MCQ 188 Understanding Computer Files

Which class of Java can be used to access attributes of files like file permissions, length of a file, last modification time?

A Writer Class
B File Class
C Scanner Class
D Console Class
MCQ 189 Understanding Computer Files

In Java, which kind of files contain data that can be read in a text editor because the data has been encoded using a scheme such as ASCII or Unicode?

A Text files
B Binary files
C Image files
D Audio files
MCQ 190 Understanding Computer Files

In Java, which method of file class returns an array of abstract path names denoting the files in the directory?

A String[ ] list( )
B long length( )
C File [ ] listFiles ( )
D string getPath( )
MCQ 191 Stream Classes in Java

Which class defines the functionality that is available for all character input streams?

A void reader class
B Exact reader class
C Abstract reader class
D Super reader class
MCQ 192 Character Stream Classes

Which of the following format is used in Java to store a character?

A ASCII
B Unicode
C Both (A) and (B)
D None of these
MCQ 193 Stream Classes in Java

FROM THE FOLLOWING WHICH ARE THE TYPES OF STREAM CLASS IN JAVA.

A Character Stream
B Byte Steam
C Both a and b
D Boolean Stream
MCQ 194 Methods of File Class

FILE METHOD BOOLEN IS FILE() RETURNS WHICH TYPE OF VALUE OF FILE CLASS?

A TRUE OR FALSE
B YES OR NO
C 0 OR 1
D Y OR N
MCQ 195 Scanner Class

WHICH OF THE FOLLOWING IS USED AS A SEPARATOR BETWEEN FIELDS OF RECORD?

A VARIABLE
B SPACE
C PATH
D DELIMITER
MCQ 196 Understanding Computer Files

Write down some common extensions of text file.

A .txt
B .java
C .c
D All of these
MCQ 197 Understanding Computer Files

Which type of file contains data that has not been encoded as text?

A Text file
B Binary file
C Image file
D Video file
MCQ 198 Understanding Computer Files

Which of the following way to provide file reference to the File Class?

A absolute path
B relative path in string format
C directory
D both a and b
MCQ 199 Understanding Computer Files

Which of the following stream can transfer data from keyboard or from the file on a hard disk to the program?

A input stream
B output stream
C file stream
D directory stream
MCQ 200 Understanding Computer Files

Which of the right syntax to create an object of FileWriter class?

A FileWriter fwobj=new FileWriter("/java/files/one.txtโ€);
B Writer fwobj=new Writer("/java/files/one.txtโ€);
C FileWriter fwobj=new Writer("/java/files/one.txtโ€);
D FileWriter fwobj=FileWriter("/java/files/one.txtโ€);
MCQ 201 Understanding Computer Files

Which of the following is a temporary storage?

A Volate storage
B Non volatile storage
C Volatile storage
D Valid storage
MCQ 202 Understanding Computer Files

Which of the following extension is used for binary files?

A .jpeg
B .mp3
C .class
D All of above
MCQ 203 Understanding Computer Files

Which of the following is generally stored in RAM (Random Access Memory)?

A Variables
B Object
C Both A and B
D None of the given
MCQ 204 Understanding Computer Files

_____________ is/are created using character stream.

A Text file
B Program code
C Both A and B
D Array
MCQ 205 Understanding Computer Files

_____________ method of reader class reads next available character from the stream. It returns "-1" to indicate the end of stream.

A void close( )
B int read( )
C int read(-1)
D Both B and C
MCQ 206 Understanding Computer Files

Which method of file class returns true if the file or directory is hidden?

A boolean isFile( )
B boolean isfile( )
C boolean isHidden( )
D boolean exists()
MCQ 207 Understanding Computer Files

Which of the following editor is used to create text file?

A Vi
B Pico
C Gedit
D All of the given
MCQ 208 Stream Classes in Java

which class has a special feature that is breaks the input string into tokens using a delimiter ?

A scaner
B date
C calander
D stream
MCQ 209 Character Stream Classes

For character stream classes,which packageย is available for a group of classes ?

A java.util
B java.io
C java.lang
D java.util.Arrays
MCQ 210 Scanner Class

Which of the following method does not belong ย to scanner class?

A String nextLine ()
B int nextInt()
C float nextFloat ()
D int read()
MCQ 211 Methods of File Class

In file class of java, which method is used to return the name of file and directory in a directory?

A String getName ()
B String getPath ()
C String ย []list ()
D String getAbsolutePath ()
MCQ 212 Understanding Computer Files

What do we call the storage where values stored in variables are lost when a computer is shutdown?

A Volatile storage
B Non- volatile
C Access storage
D Both a and b
MCQ 213 Understanding Computer Files

There are โ€ฆโ€ฆโ€ฆโ€ฆโ€ฆmethods of โ€œfile classโ€ that can be used to perform various operations on a file or directory.

A 10
B 20
C 30
D 40
MCQ 214 Understanding Computer Files

A โ€ฆโ€ฆ.. is an abstract representation of an input or output device that is used as a source or destination for data.

A Stream
B Binary
C File
D Directory
MCQ 215 Understanding Computer Files

In Java, which method of file writer class writes the lower 16 bits of โ€˜cโ€™ to the stream?

A void write (int c)
B void write (string s)
C boolean write (int c)
D string (write (int c)
MCQ 216 Understanding Computer Files

In Java, which of the following classes can be used to get the input from the keyboard, when input to be typed in hidden form?

A java.util. Scanner
B java.util.Console
C java.io.Console
D java.io.File Reader
MCQ 217 Understanding Computer Files

In Java, which method of scanner class, scans the next token of the input as Line?

A string next( )
B boolean hasNext ( )
C int next Line ( )
D string nextLine ( )
MCQ 218 Understanding Computer Files

Which class of Java can be used to access attributes of files like file permissions, length of a file, last modification time?

A Writer Class
B File Class
C Scanner Class
D Console Class
MCQ 219 Understanding Computer Files

In Java, which kind of files contain data that can be read in a text editor because the data has been encoded using a scheme such as ASCII or Unicode?

A Text files
B Binary files
C Image files
D Audio files
MCQ 220 Understanding Computer Files

In Java, which method of file class returns an array of abstract path names denoting the files in the directory?

A String[ ] list( )
B long length( )
C File [ ] listFiles ( )
D string getPath( )
MCQ 221 Stream Classes in Java

Which class defines the functionality that is available for all character input streams?

A void reader class
B Exact reader class
C Abstract reader class
D Super reader class
MCQ 222 Character Stream Classes

Which of the following format is used in Java to store a character?

A ASCII
B Unicode
C Both (A) and (B)
D None of these
MCQ 223 Console Class

Which class can be used to get input from the keyboard and the input is to be typed in hidden form ?

A Scanner
B Console
C Stream
D Date
MCQ 224 Scanner Class

Which of the following method does not belong ย to scanner class?

A String nextLine ()
B int nextInt()
C float nextFloat ()
D int read()
MCQ 225 Methods of File Class

FILE METHOD BOOLEN IS FILE() RETURNS WHICH TYPE OF VALUE OF FILE CLASS?

A TRUE OR FALSE
B YES OR NO
C 0 OR 1
D Y OR N
MCQ 226 Scanner Class

WHICH OF THE FOLLOWING IS USED AS A SEPARATOR BETWEEN FIELDS OF RECORD?

A VARIABLE
B SPACE
C PATH
D DELIMITER
MCQ 227 Understanding Computer Files

WHICH STORAGE IS PERMANANET STORAGE DATA IS NOT LOST WHEN A COMPUTER LOSES POWER?

A VOLATILE STORGAE
B NON-VOLATILE
C BOTH (A) & (B)
D OBJECT DATA
MCQ 228 Understanding Computer Files

Which of the following storage is temporary storage in computer system?

A Volatile storage
B non- volatile Storage
C Access storage
D Both a and b
MCQ 229 Understanding Computer Files

Which of the following are the examples of Non- volatile or permanent storage device?

A Hard disk, USB drive
B Optical disk
C CD
D All of these
MCQ 230 Understanding Computer Files

Which of the following file class method returns true if the file exists, otherwise return false?

A booleangetFile( )
B boolean isFile( )
C Boolean exists( )
D Boolean srcFile( )
MCQ 231 Understanding Computer Files

Which of the following refers to a collection of data stored on a nonvolatile device in a computer system?

A Hard disk
B volatile data
C Application
D File
MCQ 232 Understanding Computer Files

__________________ class in Java is used to write bytes to the file or some output stream.

A FileReadStream
B FileOutputStream
C FileInputStream
D All of the given
MCQ 233 Understanding Computer Files

Which of the following is used to encode data of text file?

A ASCII
B UNICODE
C A or B
D None of the given
MCQ 234 Understanding Computer Files

Which of the following can be accepted by the constructors of FileOutputStream?

A A string containing the path to the file location
B An object of the file class
C A or B Compiled
D Name of the directory
MCQ 235 Understanding Computer Files

___________ method of file class returns the name of file or directory referred by the object.

A String get( )
B String getName( )
C String getFile( )
D String Name( )
MCQ 236 Stream Classes in Java

FROM THE FOLLOWING WHICH ARE THE TYPES OF STREAM CLASS IN JAVA.

A Character Stream
B Byte Steam
C Both a and b
D Boolean Stream
MCQ 237 Understanding Computer Files

Write down some common extensions of text file.

A .txt
B .java
C .c
D All of these
MCQ 238 Understanding Computer Files

Which type of file contains data that has not been encoded as text?

A Text file
B Binary file
C Image file
D Video file
MCQ 239 Understanding Computer Files

Which of the following way to provide file reference to the File Class?

A absolute path
B relative path in string format
C directory
D both a and b
MCQ 240 Understanding Computer Files

Which of the following extension is used for binary files?

A .jpeg
B .mp3
C .class
D All of above
MCQ 241 Understanding Computer Files

Which method of file class returns true if the file or directory is hidden?

A boolean isFile( )
B boolean isfile( )
C boolean isHidden( )
D boolean exists()
MCQ 242 Understanding Computer Files

Which of the following editor is used to create text file?

A Vi
B Pico
C Gedit
D All of the given
MCQ 243 Character Stream Classes

For character stream classes,which packageย is available for a group of classes ?

A java.util
B java.io
C java.lang
D java.util.Arrays
MCQ 244 Methods of File Class

In file class of java, which method is used to return the name of file and directory in a directory?

A String getName ()
B String getPath ()
C String ย []list ()
D String getAbsolutePath ()
MCQ 245 Understanding Computer Files

There are โ€ฆโ€ฆโ€ฆโ€ฆโ€ฆmethods of โ€œfile classโ€ that can be used to perform various operations on a file or directory.

A 10
B 20
C 30
D 40
MCQ 246 Stream Classes in Java

Which class defines the functionality that is available for all character input streams?

A void reader class
B Exact reader class
C Abstract reader class
D Super reader class
MCQ 247 Character Stream Classes

Which of the following format is used in Java to store a character?

A ASCII
B Unicode
C Both (A) and (B)
D None of these
MCQ 248 Understanding Computer Files

FROM THE FOLLOWING WHICH EXTENSION ARE USED TO INDICATE TEXT FILES.

A .C
B .TXT
C .JAVA
D ALL OF THESE
MCQ 249 Scanner Class

WHICH OF THE FOLLOWING IS USED AS A SEPARATOR BETWEEN FIELDS OF RECORD?

A VARIABLE
B SPACE
C PATH
D DELIMITER
MCQ 250 Understanding Computer Files

Binary files can also be used to storeโ€ฆโ€ฆโ€ฆโ€ฆโ€ฆโ€ฆ.

A arrays
B object
C Function
D Both a or b
MCQ 251 Understanding Computer Files

Character stream classes can be used to read and write how many bit Unicode character?

A 16
B 32
C 8
D 4
MCQ 252 Character Stream Classes

For character stream classes,which packageย is available for a group of classes ?

A java.util
B java.io
C java.lang
D java.util.Arrays
MCQ 253 Console Class

Which class can be used to get input from the keyboard and the input is to be typed in hidden form ?

A Scanner
B Console
C Stream
D Date
MCQ 254 Methods of File Class

In file class of java, which method is used to return the name of file and directory in a directory?

A String getName ()
B String getPath ()
C String ย []list ()
D String getAbsolutePath ()
MCQ 255 Character Stream Classes

Which of the following format is used in Java to store a character?

A ASCII
B Unicode
C Both (A) and (B)
D None of these
MCQ 256 Methods of File Class

In file class of java, which method is used to return the name of file and directory in a directory?

A String getName ()
B String getPath ()
C String ย []list ()
D String getAbsolutePath ()
MCQ 257 Scanner Class

Which of the following method does not belong ย to scanner class?

A String nextLine ()
B int nextInt()
C float nextFloat ()
D int read()