GSEB XII: COMPUTER SCIENCE: CH-9: FILE HANDLING IN JAVA (Ref. to Guide)
1)
Storage
devices of a computer can be broadly classified into……. Categories.
(a)
one
(b) two
(c)
three
(d)
four
2)
………
storage is temporary.
(a) Volatile
(b)
Non-volatile
(c)
Movable
(d)
Immovable
3)
In…….
storage values stored in variables are lost when a computer is shutdown.
(a) volatile
(b)
non-volatile
(c)
movable
(d)
immovable
4)
A java program that stores a value in a….. uses
Random Access Memory (RAM).
(a)
cell
(b)
program
(c) variable
(d)
all
of these
5)
Apart
from variables, objects and their
references are generally stored in………..
(a)
ROM
(b)
PROM
(c) RAM
(d)
Hard
Disk
6)
Once
the program terminates or the computer shuts down, the data is…………..form RAM>
(a)
stored
(b) lost
(c)
available
(d)
Accessible
7)
…….
storage is permanent storage.
(a)
Volatile
(b) Non-volatile
(c)
Movable
(d)
Immovable
8)
Data
is not……. When a computer loses power in a Non-volatile storage.
(a)
stored
(b) lost
(c)
available
(d)
accessible
9)
When
a java program Is saved on a disk, it is
using…….. storage.
(a)
temporary
(b)
provisional
(c)
conditional
(d) permanent
10)
A
computer……… is a collection of data stored on a non-volatile device.
(a) file
(b)
desktop
(c)
directory
(d)
device
11)
………..exist
on permanent storage devices, such as hard disks, USB drives, optical disks and
compact discs.
(a) Files
(b)
Manuals
(c)
Directories
(d)
Devices
12)
Data
stored in files is often called……… data.
(a)
text
(b) persistent
(c)
informative
(d)
binary
13)
Files
can be further classified broadly into ……….categories.
(a)
one
(b) two
(c)
three
(d)
four
14)
………files
contain data that can be read In a text editor.
(a) Text
(b)
Manuscript
(c)
Memo
(d)
Binary
15)
In
the ………files the data has been encoded using a scheme such as ASCII or Unicode.
(a) text
(b)
memo
(c)
information
(d)
binary
16)
……….
files can be data files that contain facts, such as payroll file that contains
employee numbers, names and salaries.
(a)
Binary
(b)
Memo
(c)
Program
(d) Text
17)
Some………..files can be program files or application files
that store software instructions.
(a)
binary
(b)
memo
(c)
program
(d) text
18)
………….are
examples of editors through which text files can be created.
(a)
gedit
(b)
vi
(c)
pico
(d) all of these
19)
The extensions of the files created through the
above editor can have an extension like …………
(a)
txt
(b)
java
(c)
c
(d) All of these
20)
………….
Files contain data that has not been encoded as text.
(a) Binary
(b)
Memo
(c)
Informative
(d)
Text
21)
The
contents of a…… files are in binary format, which means the data is accessed in
terms of bytes.
(a) binary
(b)
memo
(c)
informative
(d)
text
22)
The
binary files extensions example are…………..
(a)
jpeg
(b)
mp3
(c)
class
(d) all of these
23)
Java
language supports various operations that can be performed on file or no………….
(a)
programs
(b)
attributes
(c) directories
(d)
queries
24)
…………..
operations that can be performed on
files using java programs.
(a)
Determining
the path of a file or a directory
(b)
Opening
a file
(c)
Writing
to a file
(d) All of these
25)
………operations
that can be performed on files using java programs.
(a)
Reading
from a file
(b)
Closing
or deleting a file
(c)
Querying
the attributes of file
(d) All of these
26)
Java
provides built-in……… that contain methods to help with the tasks related to
files.
(a)
variables
(b)
packages
(c) classes
(d)
devices
27)
The
java classes are present in package.
(a)
java.bytes.
(b) java.io
(c)
java.util
(d)
java.method
28)
Java
uses the concepts of ………..in file handling.
(a)
file
systems
(b) streams
(c)
packages
(d)
classes
29)
Java
provides ………..different categories of
java classes to perform I/O operations on bytes and characters.
(a)
one
(b) two
(c)
three
(d)
four
30)
Which
of the following is not a Binary file extension ?
(a)
jpeg
(b)
mp3
(c)
class
(d) txt
31)
Which
of the following is not a text file extension ?
(a)
txt
(b)
java
(c) jpeg
(d)
c
32)
The…..
class encapsulates information about the properties of a file or a directory.
(a)
java.io.file
(b)
java.oi.file
(c)
java.util.io
(d)
java.io.util
33)
………class
can be used to access attributes of files and directors.
(a)
File
(b)
I/O
(c)
java
(d)
util
34)
A
programmer can do……..a file or a directory.
(a)
create
(b)
rename
(c)
delete
(d)
all of these
35)
The………
of a file can also be accessed like its permissions, length of a file or last
modification time.
(a)
features
(b)
attributes
(c)
qualities
(d)
traits
36)
the……
creation of a file object that belongs to ……..class does not imply that the
file or directory exists.
(a)
file
(b)
I/O
(c)
java
(d)
util
37)
A
file ………… encapsulates a pathname or
reference to a physical file or a directory on the hard disk.
(a)
method
(b)
class
(c)
object
(d)
handler
38)
There
are nearly ……….. that can be used to perform various operations on a file or a
directory.
(a)
25
methods
(b)
30 methods
(c)
35
methods
(d)
20 methods
39)
…………..
does not provide any methods to read from a file or write into a file.
(a)
File class
(b)
File
methods
(c)
File
object
(d)
File
operator
40)
There
are several …………classes to perform to read from a file or write into a file.
(a)
file
(b)
stream
(c)
package
(d)
object
41)
By
using the file class, one can create a……….. to any file by providing its
absolute path in string format or by providing the relative path.
(a)
location
(b)
reference
(c)
stream
(d)
object
42)
The
file class provides……….constructors to refer a file or a directory.
(a)
File
(String path)
(b)
File
(String directory_path, String file_name)
(c)
File
(File directory, String file_name)
(d)
All of these
43)
In
Linux, “passwd” file is present in………. directory stores the information of the
users existing in the system.
(a)
“/etc”
(b)
“/pwd”
(c)
“/file”
(d)
“/dir”
44)
Suppose
one wants to display its attributes, then its java file object can be created
using ……….ways.
(a)
one
(b)
two
(c)
three
(d)
four
45)
…………method
of file class returns true if the file or directory exists, otherwise returns
false.
(a)
boolean exists ( )
(b)
boolean
isFile ( )
(c)
boolean
isDirectory ( )
(d)
boolean
isHidden ( )
46)
………..method
of file class returns true if the file
exists, otherwise returns false.
(a)
boolean
exists (
)
(b)
boolean isFile ( )
(c)
boolean
isDirectory ( )
(d)
boolean
isHidden( )
47)
……….method
of file class returns true if the directory exists, otherwise false.
(a)
boolean
exists( )
(b)
boolean
isFile( )
(c)
boolean isDirectory( )
(d)
boolean
isHidden( )
48)
…………
method of file class returns true if the file of directory is hidden.
(a)
boolean
exists ( )
(b)
boolean
isFile( )
(c)
boolean
isDirectroy( )
(d)
boolean isHidden( )
49)
………..method
of file class returns the absolute path of the file exists or directory.
(a)
String
[ ] list ( )
(b)
String
getPath ( )
(c)
String
getName ( )
(d)
String getAbsolutePath (
)
50)
…………method
of file class returns the name of the file or directory referred by the object.
(a)
String
[ ] list ( )
(b)
String
getPath ( )
(c)
String getName ( )
(d)
String
getAbsolutePath ( )
51)
………..method
of file class returns the path to the file or directory.
(a)
String
[ ] list ( )
(b)
String getPath ( )
(c)
String
getName ( )
(d)
String
getAbsolutePath ( )
52)
……….method
of file class returns the name of the files and directories in a directory.
(a)
String [ ] list ( )
(b)
String
getPath ( )
(c)
String
getName ( )
(d)
String
getAbsolutePath ( )
53)
…………method
of file class returns the number of bytes in that file.
(a)
Long length( )
(b)
File
[ ] listFiles ( )
(c)
Both
(a) and (c)
(d)
None
of these
54)
…………
method of file class returns an array of abstract pathnames denoting the files
in the directory.
(a)
Long
length ( )
(b)
File [ ] listFiles( )
(c)
Both
(a) and (b)
(d)
None
of these
55)
……….method
to list the files present in a
directory.
(a)
display
()
(b)
list( )
(c)
dir()
(d)
files()
56)
To
modify a file or display the contents of a file, the concept of…….. has to be
understood.
(a)
files
(b)
streams
(c)
packages
(d)
objects
57)
Java
uses……classes to carry out read and write operations on files.
(a)
files
(b)
streams
(c)
packages
(d)
Objects
58)
………is
an input device.
(a)
Monitor
(b)
Speaker
(c)
Keyboard
(d)
Plotter
59)
………is
an output device.
(a)
Monitor
(b)
Speaker
(c)
Keyboard
(d)
Plotter
60)
……….can
be classified as both input and output device as data can be stored and read
from the files.
(a)
Monitor
(b)
Speaker
(c)
Keyboard
(d)
Hard disk
61)
…………..are
manufactured by various companies and come with different storage capacities
like 500GB or 1TB.
(a)
Monitor
(b)
Speaker
(c)
Keyboard
(d)
Hard disk
62)
………..can
be connected using different cables like USB or SATA.
(a)
Hard disk
(b)
Scanner
(c)
Printer
(d)
Mouse
63)
A java programmer does not need to worry about
the technical details like type of………. Or its capacity while developing a
program to perform read / write operations over the files.
(a)
hard disk
(b)
scanner
(c)
printer
(d)
mouse
64)
The
above point is possible because java language provides functionality of……
(a)
files
(b)
streams
(c)
directories
(d)
objects
65)
A………
is an abstract representation of an input or output device that is used as a
source or destination for data.
(a)
file
(b)
directory
(c)
stream
(d)
disk
66)
Visualize
a…….. as a sequence of bytes that flows into the program or that flows out of
the program.
(a)
file
(b)
directory
(c)
stream
(d)
disk
67)
One
can write data or read data using………..
(a)
files
(b)
streams
(c)
directories
(d)
objects
68)
When
data Is written to stream, the stream is called an……… .
(a)
output stream
(b)
input
stream
(c)
I/O
stream
(d)
Both
(a) and (b)
69)
The
……… can transfer data from the program
to a file on a hard disk or a monitor or to some other computer over the network.
(a)
output stream
(b)
input
stream
(c)
I/O
stream
(d)
Both
(a) and (b)
70)
An………
is used to read data form an external device to the program.
(a)
output
stream
(b)
input stream
(c)
I/O
stream
(d)
Both
(a) and (b)
71)
………can
transfer data from keyboard or from the file on a hard disk to the program.
(a)
Output
stream
(b)
Input stream
(c)
I/O
stream
(d)
Both
(a) and (b)
72)
The
main reason for using streams for input or output operations is to make our
program independent of the………involved.
(a)
hard
Disks
(b)
keyboards
(c)
printers
(d)
devices
73)
………is
advantage of using streams.
(a)
Programmer
does not need to worry about the technical details of the device.
(b)
The
program can work for a variety of input/output devices without any changes to
the source code.
(c)
Both (a) and (b)
(d)
None
of these
74)
To
understand byte streams and character streams, one needs to differentiate
between character and byte…………….
(a)
representation
(b)
collection
(c)
numbers
(d)
particulars
75)
If
‘5’ is represented as a character, its ASCII value will be…. .
(a)
51
(b)
52
(c)
53
(d)
54
76)
If
‘5’ is represented as a character, its binary representation will be…… .
(a)
53
(b)
5
(c)
101
(d) 00110101
77)
If
‘5’ is represented as a binary number, then its binary representation will be………
(a)
53
(b) 5
(c)
five
(d)
101
78)
If
‘5’ is represented as a binary number, then its binary representation will
be………… .
(a) 00000101
(b)
11001100
(c)
10101100
(d)
11111000
79)
A
character is generally stored using
ASCII or Unicode format but when it is used for calculation purpose but
when it is used for calculation purpose and then it’s ……..value is meaningful.
(a) binary
(b)
actual
(c)
objective
(d)
text
80)
In
the statement int I = 32, the……… is true.
(a)
Declares
‘i’ as an integer type variable
(b)
That
‘i’ stores number 32.
(c) Both (a) and (b)
(d)
None
of these
81)
The
number 32 can be represented as two separate…….. ‘3’ and ‘2’.
(a)
numbers
(b)
values
(c) characters
(d)
all
of these
82)
For
numerical calculations, data types like int, float or double are used, that
allows storing the numbers in…………format.
(a)
numbers
(b)
text
(c)
character
(d) binary
83)
Java
supports two types of streams,…………. Streams and …….stream.
(a)
byte
(b)
character
(c) both (a) and (b)
(d)
none
of these
84)
………transfer
data in the form of bytes to the file or devices are known as byte stream of
binary stream.
(a) Streams
(b)
Files
(c)
Data
flow
(d)
Commands
85)
The
files that are created using……… stream are known as binary files.
(a) byte
(b)
character
(c)
both
(a) and (b)
(d)
none
of these
86)
If
variables are to be stores like integer, double or Boolean into a file, then
……..files should be used.
(a)
byte
(b)
text
(c)
character
(d) binary
87)
……..files
can also be used to store arrays or objects.
(a)
Byte
(b)
Text
(c)
Character
(d) Binary
88)
Similarly
text files and program codes are created using………. stream.
(a)
byte
(b) character
(c)
both
(a) and (b)
(d)
none
of these
89)
Text
files and program codes can be opened in text editors like vi and SciTE.
(a)
SciTE
(b)
vi
(c) Both (a) & (b)
(d)
None
of these
90)
Java
provides ……….set of classes, character stream class and binary stream class.
(a)
one
(b) two
(c)
three
(d)
four
91)
Character
Stream classes are present in java.io package deal with the……….. text data.
(a)
byte
(b) character
(c)
both
(a) and (b)
(d)
none
of these
92)
Java
streams can be classified into…….. basic types.
(a)
one
(b) two
(c)
three
(d)
four
93)
Java
streams are namely input stream and ………stream.
(a)
stream
(b)
byte
(c) output
(d)
character
94)
The………..
stream reads data from the source (file, keyboard(D)
(a)
stream
(b) byte
(c)
output
(d)
character
95)
The………
stream writes data to the destination
(file,output deveice).
(a)
stream
(b)
byte
(c) output
(d)
character
96)
The……..
package contains a collection or stream classes that support reading and
writing in a file.
(a) java. io
(b)
java.package
(c)
java.utill
(d)
all
of these
97)
…………..stream
classes are a group of classes available in java. io package.
(a)
Input
(b)
Byte
(c)
Output
(d) Character
98)
Character
stream classes can be used to read and write………. Unicode characters.
(a)
8bit
(b)
16bit
(c)
32bit
(d) 65bit
99)
……..stream
classes can be further classified into reader and writer classes.
(a)
Input
(b)
Byte
(c)
Output
(d)
Character
100)
…………classes
are a group of classes designed to read characters from files.
(a)
Writer
(b) Reader
(c)
Output
(d)
Input
101)
The………
classes are a group of classes designed to write characters into a file.
(a) writer
(b)
reader
(c)
character
(d)
byte
102)
Writer
classes are inherited from the………… class.
(a) object
(b)
writer
(c)
reader
(d)
character
103)
Writer
classes are…………classes (classes that cannot be used to create an object) and
come with set of methods to be implemented by its subclasses.
(a)
intellectual
(b) abstract
(c)
byte
(d)
java.io
104)
InputStreamReader
and BufferedReader are the subclass
of……class.
(a)
object
(b)
writer
(c) reader
(d)
character
105)
………….class
is the subclass of InputStreamReader class.
(a) FileReader
(b)
FileWriter
(c)
FileJava
(d)
JavaFile
106)
OutputStream
Writer, bufferedWriter and printWriter are the subclasses of ……….class.
(a)
object
(b) writer
(c)
reader
(d)
character
107)
FileWriter
class is the….. of OutputStream Writer class.
(a)
superclass
(b)
sub.io
(c) subclass
(d)
baseclass
108)
Writer
class is the ………… for writing a character stream.
(a)
superclass
(b)
sub.oi
(c)
subclass
(d) baseclass
109)
The
abstract …………class defines the functionality that is available for all
character output stream.
(a)
object
(b) writer
(c)
reader
(d)
character
110)
Methods
of………….class are used by its subclasses.
(a) writer
(b)
object
(c)
reader
(d)
character
111)
The
writer method…………. Closes the stream.
(a)
void
writer(int C)
(b) void close()
(c)
void
writer (String s)
(d)
All
of these
112)
The
writer method ………….writers string ‘s’ to the stream.
(a)
void
writer(int C)
(b)
void
close()
(c) void writer (String s)
(d)
All
of these
113)
The
writer method……… writes the lower 16 bits of ‘c’ to the stream.
(a) void writer(int C)
(b)
void
close()
(c)
void
writer (String s)
(d)
All
of these
114)
The
OutputStream…….. class extends Writer class.
(a) writer
(b)
object
(c)
reader
(d)
character
115)
The…….
Converts stream of characters to a stream of bytes.
(a)
InputStream
(b) OutputStream
(c)
ReaderStream
(d)
WriterStream
116)
The
FileWriter class extends …………Writer and outputs characters to a file.
(a)
InputStream
(b) OutputStream
(c)
ReaderStream
(d)
WriterStream
117)
The
FileWriter class has……… constructor which throws IOException
(a)
FileWriter
(String filepath)
(b)
FileWriter
(File fileobj)
(c)
FileWriter
(String filepath, Boolean append)
(d) All of these
118)
Which
of the following constructor is of FileWriter Class ?
(a) FileWriter (String filepath)
(b)
FileWriter
(File fileobj)
(c)
FileWriter
(String filepath, Boolean append)
(d)
All
of these
119)
In
the constructor “………”. If append is true, characters are appended to the end of
file, otherwise the existing contents of the file are overwritten.
(a)
FileWriter
(String filepath)
(b)
FileWriter
(File fileobj)
(c) FileWriter (String filepath, Boolean append)
(d)
None
of these
120)
In
the following example an object of……. Can be created.
FileWriterfwobject =
new FileWriter (“/java/files/Charfile1.txt”);
(a)
FileStream
(b) FileWriter
(c)
FileReader
(d)
FileDemo
121)
It
is important to close the stream…….. after writing to a file is accomplished.
(a) object
(b)
reader
(c)
file
(d)
directory
122)
……………files
consume system resources and depending on the file mode.
(a)
Closed
(b)
Large
(c)
Small
(d) Open
123)
…………..class
Is the base class for reading a character stream.
(a)
Object
(b) Reader
(c)
File
(d)
Directory
124)
The
abstract……..class defines the functionality that is available for all character
input streams.
(a)
object
(b)
reader
(c)
file
(d)
directory
125)
………….class
should be use in program to perform read
operations.
(a)
FileStream
(b)
FileWriter
(c)
FileReader
(d)
FileDemo
126)
…………method
of Reader class closes the stream.
(a)
void close ()
(b)
int
read()
(c)
void
read()
(d)
None
of these
127)
…………..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)
void
read()
(d)
None
of these
128)
The
InputSTreamReader class extends ………..class.
(a)
stream
(b)
writer
(c)
reader
(d)
demo
129)
………..class
converts a stream of bytes to a stream of characters.
(a)
Stream
(b)
Writer
(c)
Reader
(d)
Demo
130)
The………..
class extends InputStramReader class and reads characters from a file.
(a)
FileStream
(b)
FileWriter
(c)
FileReader
(d)
FileDemo
131)
Which
of the following is a FileReader constructor ?
(a)
FileReader
(Strign filepath)
(b)
FileReader
(File fileobj)
(c)
Both (a) and (b)
(d)
None
of these
132)
Which
of the following is not a FileReader constructor ?
(a)
FileReader
(String filepath)
(b)
FileReader
(File fileobj)
(c)
Both
(a) and (b)
(d)
FileReader (I, int j)
133)
In
the following example – an object of …….. can be created.
FileReader frobject = new FileReader
(“/java/files/Charfile1.txt”);
(a)
FileReader
(b)
FileWriter
(c)
Both
(a) and (b)
(d)
FileDemo
134)
………….is
a special symbol to identify end of file.
(a)
/* */
(b)
EOF
(c)
//
(d)
}
135)
………..is
a special symbol to identify end of file.
(a)
program
(b)
code
(c)
class
(d)
method
136)
The
java……..method returns “-1” to identify the end of data in the stream.
(a)
close()
(b)
read()
(c)
print()
(d)
write()
137)
The……….
and ……….. classes in the java.io package, give the ability to read and write
from and into files in the disk.
(a)
FileInputStream
(b)
FileOutputStream
(c)
FileReaderStream
(d)
Both (a) and (b)
138)
The
above mentioned streams are the sub-classes of……….. and ………classes.
(a)
ReaderStream
(b)
InputStream
(c)
OutputStream
(d)
Both (b) and (c)
139)
The
file……… is a subclass of OutputStream class closes the file output stream and
release any system resources associated with the stream.
(a)
ReaderStream
(b)
InputStream
(c)
OutputStream
(d)
Both
(b) and (c)
140)
………method
of FileOut[itStream class closes the file output stream and releases any system
resources associated with the stream.
(a)
void
write (int b)
(b)
void close ()
(c)
void
write (byte[] b)
(d)
void
write (byte[] b)
141)
…………..method
of FileOutputStream class writes the specified byte to this file output stream.
(a)
void write (int b)
(b)
void close ()
(c)
void
write (byte[] b)
(d)
void
write (byte[] b)
142)
…………..method
of FileOutputStream class writes b.length bytes from the specified byte array
to this file output stream.
(a)
void
write(int b)
(b)
void
close()
(c)
void writer(byte[] b)
(d)
void
read()
143)
The
constructors of………..can accept either a string containing the path to the file
location or an object of the file class.
(a)
FileOutputStream
(b)
FileInputStream
(c)
FileReaderStream
(d)
FileConstructor
144)
The
constructor FileOutputStream (String name) throws…………..
(a)
FileOutofBoundsException
(b)
FileNotFoundException
(c)
FileFoundException
(d)
None
of these
145)
The
constructor FileOutputStream (File file) throws…….. .
(a)
FileOutofBoundsException
(b)
FileNotFoundException
(c)
FileFoundException
(d)
None
of these
146)
The
following example will create an instance of……….
FileOutputStreamfosobject
= new
FileOutputStream (“/home/Akash/myfile.txt”);
(a)
FileOutputStream
(b)
FileInputStream
(c)
FileReaderStream
(d)
FileConstructor
147)
The…….
Is a subclass of InputStream and is
generally used to read byte data from the files.
(a)
FileInputStream
(b)
FileReaderStream
(c)
FileWriterStream
(d)
FileOutputStream
148)
………….method
of FileInputStream class reads a byte of data from this input stream.
(a)
void
close ( )
(b)
int
read(byte[ ] b)
(c)
int read ( )
(d)
void
write ()
149)
……………..method
of FileInputStream class closes the file input Stream and releases any system
resources associated with the stream.
(a)
void close ( )
(e)
int read(byte[ ] b)
(f)
int
read ( )
(b)
void
write ()
150)
…………….
Method of FileInputStream class reads up to b.length bytes of data from this
input stream into an array of bytes.
(a)
void
close( )
(b)
int read (byte[ ] b)
(c)
int
read ( )
(d)
void
write ( )
151)
A…………..
can get input from live interaction through keyboard /GUI or it may take input
as command line arguments or from the files.
(a)
program
(b)
code
(c)
class
(d)
method
152)
…………..class
belongs to the java.util package.
(a)
Printer
(b)
Console
(c)
Scanner
(d)
Keyboard
153)
It
provides various methods to real input from the……or from the file.
(a)
printer
(b)
console
(c)
scanner
(d)
keyboard
154)
A
special feature of this class is that it breaks the input string into tokens
(words) using a……..
(a)
delimiter
(b)
printer
(c)
console
(d) White space
155)
……………is
the default delimiter.
(a)
Delimiter
(b)
Printer
(c)
Console
(d) White space
156)
Each……….
Can be of different type, for example a
string like “india-1947” can also be read as “String-int”
values.
(a)
symbol
(b) token
(c)
word
(d)
mark
157)
which
of the following is not a scanner related constructor of method ?
(a)
scanner
(String str)
(b)
scanner
(inputStream isobject)
(c)
scanner
(file fobject)
(d) scanner (files i)
158)
A……….
object can be created from a strng, file object or inputStream object.
(a)
Printer
(b)
Console
(c) Scanner
(d)
Keyboard
159)
The
method …….of scanner class closes the scanner.
(a)
Void close()
(b)
String
next()
(c)
Boolean
has next()
(d)
Int nextitn()
160)
The
method ……..of scanner class returns the next token.
(a)
Void close()
(b) String next()
(c)
Boolean
has next()
(d)
Int nextitn()
161)
The
method …….of scanner class scan the next token of the input as Int.
(a) Void close()
(b)
String
next()
(c)
Boolean
has next()
(a)
Int nextitn()
162)
The
method…….of scanner class scans the next token of the input as int.
(a)
Void close()
(b)
String
next()
(c)
Boolean
has next()
(d) Int nextitn()
163)
The
method……… of scanner class scans the next token of the input as Float.
(a) float nextFloat ( )
(b)
string next( )
(c)
Boolean
hasNext()
(d)
String
nextline ( )
164)
The
method……… of scanner class scans the next token of the input as line.
(a)
float
nextFloat ( )
(b)
string
next( )
(c)
Boolean
hasNext()
(d) String nextline ( )
165)
………..class
can also be used to read from a file.
(a)
Printer
(b)
Console
(c) Scanner
(d)
Keyboard
166)
The…………
class is especially used when the input is to be types in hidden form
(characters must not be echoed on the screen.)
(a)
Printer
(b) Console
(c)
Scanner
(d)
keyboard
167)
The…….class
provides a method for reading password.
(a)
Printer
(b) Console
(c)
Scanner
(d)
Keyboard
168)
The
console class belong to….. package.
(a) Java.io
(b)
Java.util
(c)
Java.class
(d)
Java.console
169)
………..method
of Console class is used to write a formatted string to this console’ output
stream using the specified format string and arguments.
(a)
String
readLine( )
(b)
char
[ ] readPassword ( )
(c) Console printef(String format, Object args)
(d)
None
of these
170)
…………method
of Console class reads a single line of text from the console.
(a) String readLine ( )
(b)
char [
] readPassword ( )
(c)
Console
printef(String format, Object args)
(d)
None
of these
171)
………method
of Console class reads a password or passphrase from the console with echoing
disable.
(a)
String
readLine ( )
(b) char [ ] readPassword ( )
(c)
Console
printef(String format, Object args)
(a)
None
of these
172)
Scanner
class is used for performing which of the following operations ?
(a) Read from a file
(b)
Navigate
through a file
(c)
Scan
a file
(d)
All
of these
173)
Which
of the following is correct syntax ?
(a)
Public
static void main (String args[])
(b)
Public
static void main (String args)
(c) Public static void main (String args[])
(d)
Public
static void main (String args[])
No comments
Post your comments