which class has a special feature that is breaks the input string into tokens using a delimiter ?
Ascaner
Bdate
Ccalander
Dstream
Correct Answer: Option A
Note: GSEB Commerce Oct-2020
MCQ 2Character Stream Classes
For character stream classes,which packageย is available for a group of classes ?
Ajava.util
Bjava.io
Cjava.lang
Djava.util.Arrays
Correct Answer: Option B
Note: GSEB Commerce Oct-2020
MCQ 3Console Class
Which class can be used to get input from the keyboard and the input is to be typed in hidden form ?
AScanner
BConsole
CStream
DDate
Correct Answer: Option B
Note: GSEB Commerce Oct-2020
MCQ 4Scanner Class
Which of the following method does not belong ย to scanner class?
AString nextLine ()
Bint nextInt()
Cfloat nextFloat ()
Dint read()
Correct Answer: Option D
Note: GSEB Commerce Oct-2020
MCQ 5Methods of File Class
In file class of java, which method is used to return the name of file and directory in a directory?
AString getName ()
BString getPath ()
CString ย []list ()
DString getAbsolutePath ()
Correct Answer: Option C
Note: GSEB Commerce Oct-2020
MCQ 6Stream Classes in Java
FROM THE FOLLOWING WHICH ARE THE TYPES OF STREAM CLASS IN JAVA.
ACharacter Stream
BByte Steam
CBoth a and b
DBoolean Stream
Correct Answer: Option C
Note: null
MCQ 7Understanding Computer Files
FROM THE FOLLOWING WHICH EXTENSION ARE USED TO INDICATE TEXT FILES.
A.C
B.TXT
C.JAVA
DALL OF THESE
Correct Answer: Option D
Note: null
MCQ 8Methods of File Class
FILE METHOD BOOLEN IS FILE() RETURNS WHICH TYPE OF VALUE OF FILE CLASS?
ATRUE OR FALSE
BYES OR NO
C0 OR 1
DY OR N
Correct Answer: Option A
Note: null
MCQ 9Introduction to Streams
WHICH OF THE FOLLOWING IS TRUE ABOUT STREAMS IN JAVA?
ASTREMS ALWAYS
BSTREMS ARE CHANLES
CONLY ONE STREAM
DALL OF THESE
Correct Answer: Option D
Note: null
MCQ 10Scanner Class
WHICH OF THE FOLLOWING IS USED AS A SEPARATOR BETWEEN FIELDS OF RECORD?
AVARIABLE
BSPACE
CPATH
DDELIMITER
Correct Answer: Option D
Note: null
MCQ 11Understanding Computer Files
WHICH STORAGE IS PERMANANET STORAGE DATA IS NOT LOST WHEN A COMPUTER LOSES POWER?
AVOLATILE STORGAE
BNON-VOLATILE
CBOTH (A) & (B)
DOBJECT DATA
Correct Answer: Option B
Note: null
MCQ 12Understanding Computer Files
Scanner class can be used for performing which of the following operations?
AAccept input from the keyboard
BRead from the file
Cparse a string separated by delimiters
DAll of the above
Correct Answer: Option D
MCQ 13Understanding Computer Files
Storage devices of a computer system can be broadly classified into how many categories?
Avolatile storage
Bnon- volatile Storage
CAccess storage
DBoth a and b
Correct Answer: Option D
Note: null
MCQ 14Understanding Computer Files
Which of the following storage is temporary storage in computer system?
AVolatile storage
Bnon- volatile Storage
CAccess storage
DBoth a and b
Correct Answer: Option A
Note: null
MCQ 15Understanding Computer Files
What do we call the storage where values stored in variables are lost when a computer is shutdown?
AVolatile storage
BNon- volatile
CAccess storage
DBoth a and b
Correct Answer: Option A
Note: S-March-2020
MCQ 16Understanding Computer Files
Which of the following storage is permanent storage in computer system?
AVolatile storage
BNon- volatile Storage
CAccess storage
DBoth a and b
Correct Answer: Option B
Note: null
MCQ 17Understanding Computer Files
What do we call the storage where data is not lost when a computer loses power?
AVolatile storage
BNon- volatile
CAccess storage
DBoth a and b
Correct Answer: Option B
Note: null
MCQ 18Understanding Computer Files
Which of the following are the examples of Non- volatile or permanent storage device?
AHard disk, USB drive
BOptical disk
CCD
DAll of these
Correct Answer: Option D
Note: null
MCQ 19Understanding Computer Files
File can be broadly classified into how many categories in Java?
AText file
Bbinary file
CImage file
Dboth a and b
Correct Answer: Option D
Note: null
MCQ 20Understanding Computer Files
Which file contains data that can be read in a text editor?
AText file
Bbinary file
CImage file
Dboth a and b
Correct Answer: Option D
Note: null
MCQ 21Understanding Computer Files
Name the schemes which are used to enclosed the text file?
AASCII
BUnicode
CTrue font
Dboth a and b
Correct Answer: Option D
Note: null
MCQ 22Understanding 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)
AText file
Bbinary file
CImage file
Dboth a and b
Correct Answer: Option D
Note: null
MCQ 23Understanding Computer Files
Which of the following are the examples of text editor?
AGedit
Bvi, pico
CScite
DAll of these
Correct Answer: Option D
Note: null
MCQ 24Understanding Computer Files
Write down some common extensions of text file.
A.txt
B.java
C.c
DAll of these
Correct Answer: Option D
Note: null
MCQ 25Understanding Computer Files
The contents of a Binary files are in โฆโฆโฆโฆโฆformat.
Atext
Bbinary
Cimage
Dvideo
Correct Answer: Option B
Note: null
MCQ 26Understanding Computer Files
Which type of file contains data that has not been encoded as text?
AText file
BBinary file
CImage file
DVideo file
Correct Answer: Option B
Note: null
MCQ 27Understanding Computer Files
What is the meaning of binary format?
AThe data is accessed in term of bytes.
BThe data is accessed in term of bits.
CThe data is unaccessed in term of bytes.
DThe data is accessed in terms of bite code.
Correct Answer: Option A
Note: null
MCQ 28Understanding Computer Files
Which of the following are the common extensions of binary file?
A.jpeg,
B.mp3
C.class
DAll of these
Correct Answer: Option D
Note: null
MCQ 29Understanding Computer Files
Java provides โฆโฆโฆโฆclasses that contain methods to help us with particular tasks.
Auser define
Bbuilt โ in
Cdefault
Dprepackage
Correct Answer: Option B
Note: null
MCQ 30Understanding Computer Files
Classes are present in โฆโฆโฆโฆโฆ.package.
Ajava.io
Bjava.util
Cjava.lang
Djava.util.io
Correct Answer: Option A
Note: null
MCQ 31Understanding Computer Files
Java uses the concepts of โฆโฆโฆ.which provides two different categories of java classes to perform I/O operations on bytes and characters.
Astreams
Breader
Cwriter
Dbinary
Correct Answer: Option A
Note: null
MCQ 32Understanding Computer Files
Which of the following class encapsulates information about the properties of a file or a directory?
Ajava.io.File
Bjava.io.file
Cjava.file
Djava.util.File
Correct Answer: Option A
Note: null
MCQ 33Understanding Computer Files
Which of the following class can be used to access attributes of files and directories?
Afile
Bdirectory
Cread
Dwrite
Correct Answer: Option A
Note: null
MCQ 34Understanding Computer Files
Which operations can be done on a file or a directory?
Acreate
Brename
Cdelete
DAll of these
Correct Answer: Option D
Note: null
MCQ 35Understanding Computer Files
Write down some file attributes in java.
AFile permission
Blength of a file
Clast or modification file time
DAll of these
Correct Answer: Option D
Note: null
MCQ 36Understanding Computer Files
There are โฆโฆโฆโฆโฆmethods of โfile classโ that can be used to perform various operations on a file or directory.
A10
B20
C30
D40
Correct Answer: Option C
Note: S-March-2020
MCQ 37Understanding Computer Files
How many ways to provide file reference to the File Class?
A2
B3
C4
D5
Correct Answer: Option A
Note: null
MCQ 38Understanding Computer Files
Which of the following way to provide file reference to the File Class?
Aabsolute path
Brelative path in string format
Cdirectory
Dboth a and b
Correct Answer: Option D
Note: null
MCQ 39Understanding Computer Files
In Linux. "passwdโ file present in which directory?
Aetc
Bin
Croot
Dpwd
Correct Answer: Option A
Note: S-March-2020
MCQ 40Understanding Computer Files
Which method of File Class returns true if the file or directory exists, otherwise returns false?
Aboolean isFile( )
Bboolean exists( )
Cboolean File()
DBoolean isDir( )
Correct Answer: Option B
Note: null
MCQ 41Understanding Computer Files
Which method of File Class returns the name of the file or directory referred by the object?
AString getPath( )
BString getName( )
CString( )
DString setName()
Correct Answer: Option B
Note: null
MCQ 42Understanding Computer Files
Which method of File Class returns the number of bytes in that file?
Along length( )
BString length( )
Clength( )
DStr length( )
Correct Answer: Option A
Note: null
MCQ 43Understanding Computer Files
Which method of File Class returns the name of file and directories in a directory?
AString[ ] list( )
Blong length( )
Clist( )
DList[ ] String( )
Correct Answer: Option A
Note: null
MCQ 44Understanding Computer Files
Which method of File Class returns an array of abstract path names denoting the file in the directory?
AString[ ] File( )
BFile[ ] listFiles( )
CFile list( )
DListFile( )
Correct Answer: Option B
Note: null
MCQ 45Understanding Computer Files
Which method of File Class is used to list all the files present in that directory?
Alength( )
Blist( )
Cls( )
Dls Length( )
Correct Answer: Option B
Note: null
MCQ 46Understanding Computer Files
Java uses โฆโฆโฆโฆ..classes to carry out read and write operations on files.
AStream
BBinary
CFile
DDirectory
Correct Answer: Option A
Note: null
MCQ 47Understanding Computer Files
A โฆโฆ.. is an abstract representation of an input or output device that is used as a source or destination for data.
AStream
BBinary
CFile
DDirectory
Correct Answer: Option A
Note: S-March-2020
MCQ 48Understanding Computer Files
We can visualize a โฆโฆโฆโฆโฆโฆ.as a sequence of bytes.
AStream
BBinary
CFile
DDirectory
Correct Answer: Option A
Note: null
MCQ 49Understanding Computer Files
We can โฆโฆโฆโฆโฆdata using streams.
Awrite
Bread
Cdelete
DBoth a or b
Correct Answer: Option D
Note: null
MCQ 50Understanding Computer Files
When we write data to stream, the stream is called an โฆโฆโฆโฆ..stream.
Aoutput
Binput
Cfile
Ddir
Correct Answer: Option A
Note: null
MCQ 51Understanding Computer Files
The output stream can transfer data from the program to a โฆโฆโฆโฆโฆ..
Afile
BDirectory
Croot
Detc
Correct Answer: Option A
Note: null
MCQ 52Understanding Computer Files
An โฆโฆโฆโฆ.stream is used to read data from an external device to the program.
Aoutput
Binput
Cfile
Ddir
Correct Answer: Option A
Note: null
MCQ 53Understanding Computer Files
Which of the following stream can transfer data from keyboard or from the file on a hard disk to the program?
Ainput stream
Boutput stream
Cfile stream
Ddirectory stream
Correct Answer: Option A
Note: null
MCQ 54Understanding Computer Files
A character is generally stored using which of the following format?
AASCII
BUnicode
CTRUE
DBoth a and b
Correct Answer: Option D
Note: null
MCQ 55Understanding Computer Files
When character is used for calculation purpose; its โฆโฆโฆโฆโฆ..value is meaningful.
Abinary
Bdecimal
COctal
DHexadecimal
Correct Answer: Option A
Note: null
MCQ 56Understanding Computer Files
If we want to store the statement โHuman beings have 32 teeth.โ, when which representation is advisable?
ABinary
BCharacter
CASCII
DUnicode
Correct Answer: Option B
Note: null
MCQ 57Understanding Computer Files
To apply numerical calculation, we use data types like int, float or double that allows us to store the numbers in โฆโฆโฆโฆ..format.
ABinary
BCharacter
CASCII
DUnicode
Correct Answer: Option A
Note: null
MCQ 58Understanding Computer Files
Java supports โฆโฆโฆโฆโฆ.types of streams.
Abyte stream
Bcharacter stream
Cbitecode
Dboth a and b
Correct Answer: Option D
Note: null
MCQ 59Understanding Computer Files
What do we call the streams that transfer data in the form of bytes to the file or devices?
Abyte stream or binary stream
BCharacter stream
CBite code stream
DNone
Correct Answer: Option A
Note: null
MCQ 60Understanding Computer Files
What do we call the files that are created using byte stream?
AObject file
BBinary file
CByte file
DDirectory
Correct Answer: Option B
Note: null
MCQ 61Understanding Computer Files
Binary files can also be used to storeโฆโฆโฆโฆโฆโฆ.
Aarrays
Bobject
CFunction
DBoth a or b
Correct Answer: Option D
Note: null
MCQ 62Understanding Computer Files
Text files and program codes are created using which type of stream?
Abyte or binary stream
BCharacter stream
Cbite code stream
DNone
Correct Answer: Option B
Note: null
MCQ 63Understanding Computer Files
Text files can be opened inโฆโฆโฆโฆsoftware. Like vi or SciTE
Atext editor
Bword processor
Cbrowser
Dpresentation
Correct Answer: Option A
Note: null
MCQ 64Understanding Computer Files
Stream classes are presents in which package?
Ajava.io
Bjava.util
Cjava.util.io
Djava *.io
Correct Answer: Option A
Note: null
MCQ 65Understanding Computer Files
Character stream classes deal with which of the following data?
Acharacter
Btext
Cnumber
Dboth a or b
Correct Answer: Option D
Note: null
MCQ 66Understanding Computer Files
Byte stream classes deal with which of the following data?
Abinary
Bcharacter
Ctext
Dnumber
Correct Answer: Option A
Note: null
MCQ 67Understanding Computer Files
An โฆโฆโฆโฆโฆ..stream reads data from the source (file, keyboard).
Ainput
Boutput
Cfile
DDirectory
Correct Answer: Option A
Note: null
MCQ 68Understanding Computer Files
An โฆโฆโฆโฆโฆ. stream writes data to the destination (file, output device).
Ainput
Boutput
Cfile
DDirectory
Correct Answer: Option A
Note: null
MCQ 69Understanding Computer Files
The java.io package contains a collection of stream classes that support ..โฆโฆโฆin a file.
Areading
Bwriting
Cexecutive
Dboth a and b
Correct Answer: Option D
Note: null
MCQ 70Understanding Computer Files
To use reading or writing classes, which package do we need to import in our program?
Ajava.io
Bjava.util
Cjava.lang
Djava.*.lang
Correct Answer: Option A
Note: null
MCQ 71Understanding Computer Files
Java streams can be classified into which of the following basic types?
Ainput stream
Boutput stream
Cbit stream
Dcharacter stream
Correct Answer: Option D
Note: null
MCQ 72Understanding Computer Files
Character stream classes can be used to read and write how many bit Unicode character?
A16
B32
C8
D4
Correct Answer: Option A
Note: null
MCQ 73Understanding Computer Files
Which class is a group of classes designed to read characters from files?
AWriter Class
BReader class
Cread class
Dwrite class
Correct Answer: Option B
Note: null
MCQ 74Understanding Computer Files
Which class is a group of classes designed to write characters into a file?
AWriter Class
BReader class
Cread class
Dwrite class
Correct Answer: Option A
Note: null
MCQ 75Understanding Computer Files
The java.io.Reader class and java.io.Writer class are inherited from the โฆโฆโฆโฆclass.
Aobject
Bfile
CDirectory
DVariable
Correct Answer: Option A
Note: null
MCQ 76Understanding Computer Files
InputStreamReader and BufferReader are the subclass of โฆโฆโฆโฆโฆ..class.
AWriter
BReader
CObject
DFile
Correct Answer: Option B
Note: null
MCQ 77Understanding Computer Files
OutputStreamWriter, BufferWriter and PrintWriter are the subclasses of โฆโฆโฆโฆโฆ.class.
AWriter
BReader
CObject
DFile
Correct Answer: Option A
Note: null
MCQ 78Understanding Computer Files
A detail description of methods, constructor can be obtained from online Java documentation from โฆโฆโฆโฆโฆโฆURL address.
Ahttp:// docs.oracle.com/javase/6/docs/api/
Bhttp://docs.oracle/java
Chttp://javac
Dhttp://docs/javase/api
Correct Answer: Option A
Note: null
MCQ 79Understanding Computer Files
The method of Writer class can throw which of the following exception?
AIOException
BArithmeticException
ClangException
DutilException
Correct Answer: Option A
Note: null
MCQ 80Understanding Computer Files
The OutputStreamWriter class converts stream of characters to a stream of โฆโฆโฆโฆ..
ABytes
BBits
Cpoints
DPixels
Correct Answer: Option A
Note: null
MCQ 81Understanding Computer Files
What is the meaning of filepath parameter in statement โFileWriter(String filepath);โ?
Ais the full path name of a file
BDirectory path name
CSubdirectory full path name
Dsubfile path name
Correct Answer: Option A
Note: null
MCQ 82Understanding Computer Files
What is the meaning of fileobj in statement โFileWriter(File fileobj);โ?
AIs a file object that describe the file
Bis a file object that describe directory
Cis a directory that describe the directory
Dis a directory that describe file.
Correct Answer: Option A
Note: null
MCQ 83Understanding Computer Files
What happens if append is true in statement "FileWriter (Sting filepath, boolean append);โ?
ACharacters are append to the end of file.
BCharacters are append to the start of file.
Cfiles are append to the end of directory.
DNone
Correct Answer: Option A
Note: null
MCQ 84Understanding Computer Files
What happens if append is false in statement "FileWriter (Sting filepath, boolean append);โ?
AThe existing contents of the file are overwritten
BThe existing contents of the file are same
CThe new contents of the file are append to the end of file.
DNone
Correct Answer: Option A
Note: null
MCQ 85Understanding Computer Files
Which of the right syntax to create an object of FileWriter class?
FileOutputStream class throws which type of Exception?
AFileNotFoundException
BIO Exception
CArithmetic Exception
DFileFound Exception
Correct Answer: Option A
Note: null
MCQ 90Understanding Computer Files
In Java โฆโฆโฆโฆ.is applied to convert integer to character after read operation is performed.
Atypecasting
Bcondition
Cmethods
Dconversion
Correct Answer: Option A
Note: null
MCQ 91Understanding Computer Files
โฆโฆโฆโฆโฆclass belongs to the java.util package.
AScanner
Breader
Cwriter
DArray
Correct Answer: Option A
Note: null
MCQ 92Understanding Computer Files
A special feature of scanner class is that it breaks the input string into โฆโฆusing a delimiter.
Atokens (words)
Bnumber
Ckeywords
DMethods
Correct Answer: Option A
Note: null
MCQ 93Understanding Computer Files
A scanner object can be created from a โฆโฆโฆโฆโฆโฆโฆโฆ.objects.
Astring
Bfile object
CInputStream
DAll of above
Correct Answer: Option C
Note: null
MCQ 94Understanding Computer Files
The numbers are scanned as integer numbers using the โฆโฆโฆ..method of the Scanner class.
AnextInt( )
Bnextint( )
CNextInt( )
DIntnext( )
Correct Answer: Option A
Note: null
MCQ 95Understanding Computer Files
Apart from Scanner class which is the another class which can be used to get the input from the keyboard?
AReader class
Bjava.io.Console class
Cjava.io.console class
DWriter
Correct Answer: Option B
Note: null
MCQ 96Understanding Computer Files
Which class can be used when the input is to be typed in hidden form?
AConsole class
BScanner class
CReader
DWriter
Correct Answer: Option A
Note: null
MCQ 97Understanding Computer Files
The โฆโฆโฆโฆโฆ..class provides a method for reading password.
AConsole class
BScanner class
CReader
DWriter
Correct Answer: Option A
Note: null
MCQ 98Understanding Computer Files
When reading the password the user input will be hidden or not shown in the โฆโฆโฆ screen.
AConsole
BScanner
CReader
DWriter
Correct Answer: Option A
Note: null
MCQ 99Understanding Computer Files
Console class will return an โฆโฆโฆโฆ of character as the return type.
AArray
BObject
CVariable
DMethod
Correct Answer: Option B
Note: null
MCQ 100Understanding Computer Files
The Console class belongs to โฆโฆโฆโฆโฆโฆpackage.
Ajava.io
Bjava.util
Cjava.lang
Djava.Arrays
Correct Answer: Option A
Note: null
MCQ 101Understanding Computer Files
Which method is used to write few lines into the file?
Awrite( )
Bread( )
CWriter( )
DReader( )
Correct Answer: Option A
Note: null
MCQ 102Understanding Computer Files
Which method is used to read few lines from the file?
Awrite( )
Bread( )
CWriter( )
DReader( )
Correct Answer: Option B
Note: null
MCQ 103Understanding Computer Files
Which method is used for closing a file after addition (modification)?
Aclose( )
Bquit( )
CExit( )
Dq( )
Correct Answer: Option A
Note: null
MCQ 104Understanding Computer Files
Which of the following class provides various methods to read input from file or keyboard?
AScanner
BReader
CWriter
DStream
Correct Answer: Option A
Note: null
MCQ 105Understanding Computer Files
In Java, Which of the following class returns the name of files and directories in a directory?
AString[] list( )
BBoolean isFile( )
CString getName( )
DString getPath( )
Correct Answer: Option A
Note: null
MCQ 106Understanding Computer Files
In Java, which method of Scanner class returns true of there is a token in input?
AString next( )
BBoolean hasNext( )
Cint nextInt( )
DString nextLine( )
Correct Answer: Option B
Note: null
MCQ 107Understanding Computer Files
In Java, read( ) method of file Reader class returns which value to indicate the end of stream?
A0
B-1
C1
De
Correct Answer: Option B
Note: null
MCQ 108Understanding Computer Files
Which of the following class encapsulates information about the properties of a file or a directory?
Ajava.io.File
Bjava.io.FD
Cjava.io.FileDir
Djava.io.Director
Correct Answer: Option A
Note: null
MCQ 109Understanding Computer Files
Which of the following file class method returns true if the file exists, otherwise return false?
AbooleangetFile( )
Bboolean isFile( )
CBoolean exists( )
DBoolean srcFile( )
Correct Answer: Option B
Note: null
MCQ 110Understanding Computer Files
Scanner class belongs to which of the following package?
Ajava.io.File
Bjava.pack
Cjava.scan
Djava.util
Correct Answer: Option D
Note: null
MCQ 111Understanding Computer Files
Which of the following class provides a method for reading password?
AConsole class
BFile class
CWrite class
DPassword class
Correct Answer: Option A
Note: null
MCQ 112Understanding Computer Files
Which of the following scanner class method scans the next token of the input as line?
AString nextLine( )
BString next( )
CString close( )
DVoid close( )
Correct Answer: Option A
Note: null
MCQ 113Understanding Computer Files
Which of the following is a temporary storage?
AVolate storage
BNon volatile storage
CVolatile storage
DValid storage
Correct Answer: Option C
Note: null
MCQ 114Understanding Computer Files
In Java, when we write data to stream, what is that stream called?
Adata stream
Binput stream
Coutput stream
Dline stream
Correct Answer: Option B
Note: null
MCQ 115Understanding Computer Files
In Java, text files and program codes are created using which stream?
Acharacter stream
Bbinary stream
Cbyte stream
DBoolean stream
Correct Answer: Option A
Note: null
MCQ 116Understanding Computer Files
In writer class of Java, which of the following exception occurs when there is a failed I/O operation?
AOutputException
BInputException
CFileException
DIOException
Correct Answer: Option D
Note: null
MCQ 117Understanding 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?
Ajava.file
Bjava.output
Cjava.input
Djava.io
Correct Answer: Option D
Note: null
MCQ 118Understanding Computer Files
In Java, scanner class can be used to perform which of the following operations?
AReading password
BWrite data into file
CAccept input from the keyboard
DCount number of character in file
Correct Answer: Option C
Note: null
MCQ 119Understanding Computer Files
Storage device of computer system can be broadly classified into which of the following category?
AVolatile storage
BNon-volatile storage
CDynamic storage
DBoth a and b
Correct Answer: Option D
Note: null
MCQ 120Understanding Computer Files
File can exist on which of the following permanent storage device?
AHard disk
BCompact disc
COptical disk
DAll of above
Correct Answer: Option D
Note: null
MCQ 121Understanding Computer Files
Which of the following extension is used for binary files?
A.jpeg
B.mp3
C.class
DAll of above
Correct Answer: Option D
Note: null
MCQ 122Understanding Computer Files
In Java, Which class encapsulates information about the properties of a file or a directory?
Ajava.util.Dir
Bjava.lang.Dir
Cjava.io.File
Djava.io.object.Fd
Correct Answer: Option C
Note: null
MCQ 123Understanding Computer Files
In Java, Which method of file class returns true if file exists, otherwise returns false?
Aboolean isFile( )
BBoolean listFile( )
CBoolean getFname( )
DBoolean file()
Correct Answer: Option A
Note: null
MCQ 124Understanding Computer Files
Java supports which of the stream?
AByte stream
BCharacter stream
CBoth a and b
DBinary stream
Correct Answer: Option C
Note: null
MCQ 125Understanding Computer Files
In Java, which of the following is a subclass of Reader class?
AInputstreamReader
BBufferedReader
COutputStream
DBoth a and b
Correct Answer: Option D
Note: null
MCQ 126Understanding Computer Files
In Java, read( ) method returns what to identify the end of data in the stream?
A1
B-1
C0
DEnd
Correct Answer: Option B
Note: null
MCQ 127Understanding Computer Files
In Java, which method of console class reads a single line of text from the console?
AChar Print( )
BChar getLine()
CString readLine( )
DString PrintLine( )
Correct Answer: Option C
Note: null
MCQ 128Understanding Computer Files
Which of the following refers to a collection of data stored on a nonvolatile device in a computer system?
AHard disk
Bvolatile data
CApplication
DFile
Correct Answer: Option D
Note: null
MCQ 129Understanding Computer Files
Which class provides a method for reading password?
AConsole class
BWriter class
CScanner Input class
DReader class
Correct Answer: Option A
Note: null
MCQ 130Understanding Computer Files
Which scanner class method is used to scan the next token of the input as Int?
Aint text( )
Bint nextInt( )
Cint has Next( )
Dvoid int( )
Correct Answer: Option B
Note: null
MCQ 131Understanding Computer Files
Which file class method is used to return the path to the file or directory?
AString getPath( )
BString get Name( )
CString get File( )
DString get Directory( )
Correct Answer: Option A
Note: null
MCQ 132Understanding Computer Files
In Java, which method of file writer class writes the lower 16 bits of โcโ to the stream?
Avoid write (int c)
Bvoid write (string s)
Cboolean write (int c)
Dstring (write (int c)
Correct Answer: Option A
Note: G-March-2022
MCQ 133Understanding 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?
Ajava.util. Scanner
Bjava.util.Console
Cjava.io.Console
Djava.io.File Reader
Correct Answer: Option C
Note: G-March-2022
MCQ 134Understanding Computer Files
In Java, which method of scanner class, scans the next token of the input as Line?
Astring next( )
Bboolean hasNext ( )
Cint next Line ( )
Dstring nextLine ( )
Correct Answer: Option D
Note: G-March-2022
MCQ 135Understanding Computer Files
Which class of Java can be used to access attributes of files like file permissions, length of a file, last modification time?
AWriter Class
BFile Class
CScanner Class
DConsole Class
Correct Answer: Option B
Note: G-March-2022
MCQ 136Understanding 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?
AText files
BBinary files
CImage files
DAudio files
Correct Answer: Option A
Note: G-March-2022
MCQ 137Understanding Computer Files
In Java, which method of file class returns an array of abstract path names denoting the files in the directory?
AString[ ] list( )
Blong length( )
CFile [ ] listFiles ( )
Dstring getPath( )
Correct Answer: Option C
Note: G-March-2022
MCQ 138Stream Classes in Java
Which class defines the functionality that is available for all character input streams?
Avoid reader class
BExact reader class
CAbstract reader class
DSuper reader class
Correct Answer: Option C
Note: S-March-2020
MCQ 139Character Stream Classes
Which of the following format is used in Java to store a character?
AASCII
BUnicode
CBoth (A) and (B)
DNone of these
Correct Answer: Option C
Note: S-March-2020
MCQ 140Understanding Computer Files
Which of the following is generally stored in RAM (Random Access Memory)?
AVariables
BObject
CBoth A and B
DNone of the given
Correct Answer: Option C
Note: null
MCQ 141Understanding Computer Files
The file representing the data in the form of bytes is known as _____________
ABinary file
BText file
CApplication file
DAll of the given
Correct Answer: Option A
Note: null
MCQ 142Understanding Computer Files
The ____________________ is used to read bytes data from the file in Java
AFileWriteStream
BFileOutputStream
CFileInputStream
DAll of the given
Correct Answer: Option C
Note: null
MCQ 143Understanding Computer Files
Which method of console class reads a single line of text from a console?
AChar[] readPassword
BString readLine()
CChar[] readLine
DAll of the given
Correct Answer: Option B
Note: null
MCQ 144Understanding Computer Files
Scanner class provides various methods to read input from ___________
Akeyboard
Bfile
CBoth A and B
DNone of the given
Correct Answer: Option C
Note: null
MCQ 145Understanding Computer Files
The _____class extends the writer class and converts stream of characters to a stream of bytes.
AOutputStreamWriter
BFileWriter
CInputStreamReader
DFileReader
Correct Answer: Option A
Note: null
MCQ 146Understanding Computer Files
The data in volatile storage is lost when ____________________
Athe file is saved
Bthe file is closed
Cthe computer starts
Dwhen a computer is shutdown
Correct Answer: Option D
Note: null
MCQ 147Understanding Computer Files
Which value is returned by boolean isFile() method of file class?
A0 or 1
Btrue or false
CYes or No
DNone of the given
Correct Answer: Option B
Note: null
MCQ 148Understanding Computer Files
__________________ class in Java is used to write bytes to the file or some output stream.
AFileReadStream
BFileOutputStream
CFileInputStream
DAll of the given
Correct Answer: Option B
Note: null
MCQ 149Understanding Computer Files
Which method of console class is used to read password or passphrase from the console?
AChar[] readPassword
BString readPassword
CConsole readPassword
DAll of the given
Correct Answer: Option A
Note: null
MCQ 150Understanding Computer Files
Binary files can be used to store ____________
Aarrays
Bobjects
CA or B
Dprogram code
Correct Answer: Option C
Note: null
MCQ 151Understanding Computer Files
____________________ method of scanner class scans the next token of the input as Int.
Aint nextInt()
Bboolean hasNext()
Cstring next()
Dstring nextLine()
Correct Answer: Option A
Note: null
MCQ 152Understanding Computer Files
In which of the following data is not lost when a computer loses power?
AVolatile storage
BNon-volatile storage
CBoth A and B
DNone of the given
Correct Answer: Option B
Note: null
MCQ 153Understanding Computer Files
Which method of the file class returns true if the file/directory exists else returns false?
Aboolean isFile()
Bboolean isDir()
Cboolean isDirectory()
Dboolean exists()
Correct Answer: Option D
Note: null
MCQ 154Understanding Computer Files
Which package is used to perform various operations on characters in Java?
AJava.process
Bjava.file
CJava.object
Djava.io
Correct Answer: Option D
Note: null
MCQ 155Understanding Computer Files
Which class in Java program is used to read username and password?
Ascanner
Buser
Cconsole
Dstream
Correct Answer: Option C
Note: null
MCQ 156Understanding Computer Files
_____________ is/are created using character stream.
AText file
BProgram code
CBoth A and B
DArray
Correct Answer: Option C
Note: null
MCQ 157Understanding Computer Files
_____________ method of reader class reads next available character from the stream. It returns "-1" to indicate the end of stream.
Avoid close( )
Bint read( )
Cint read(-1)
DBoth B and C
Correct Answer: Option B
Note: null
MCQ 158Understanding Computer Files
Which of the following is used to encode data of text file?
AASCII
BUNICODE
CA or B
DNone of the given
Correct Answer: Option C
Note: null
MCQ 159Understanding Computer Files
Which method of file class returns true if the file or directory is hidden?
Aboolean isFile( )
Bboolean isfile( )
Cboolean isHidden( )
Dboolean exists()
Correct Answer: Option C
Note: null
MCQ 160Understanding Computer Files
________________ method of FileInputStream in the java.io.package closes the file input stream and releases any system resources associated with the stream.
Avoid free( )
Bvoid close( )
CBoth A and B
DNone of the given
Correct Answer: Option B
Note: null
MCQ 161Understanding Computer Files
Which class is used especially when the input is to be typed in hidden form?
AScanner
BConsole
CUser
DStream
Correct Answer: Option B
Note: null
MCQ 162Understanding Computer Files
Which exception is thrown by the methods of writer class?
AFileNotFoundexception
BIOException
CArithmeticException
DNullpointerexception
Correct Answer: Option B
Note: null
MCQ 163Understanding Computer Files
____________ class breaks the input string into tokens using a delimiter.
AConsole
BScanner
CWriter
DReader
Correct Answer: Option B
Note: null
MCQ 164Understanding Computer Files
Which of the following file can be a data file?
ABinary
BText
CObject
DNone of the given
Correct Answer: Option B
Note: null
MCQ 165Understanding Computer Files
Which method of file class returns the absolute path of the file or directory?
AString get( )
BString getpath( )
CString path( )
DString getAbsolutepath( )
Correct Answer: Option D
Note: null
MCQ 166Understanding Computer Files
Which method of FileInputStream reads a byte from the input stream?
Aint read( )
Bint readdata( )
Cint readbyte( )
Dint write( )
Correct Answer: Option A
Note: null
MCQ 167Understanding Computer Files
By using which class, the characters that are typed are not shown on the screen and remain in the hidden form?
Ascanner
Buser
Cstream
Dconsole
Correct Answer: Option D
Note: null
MCQ 168Understanding Computer Files
Which of the following can be accepted by the constructors of FileOutputStream?
AA string containing the path to the file location
BAn object of the file class
CA or B Compiled
DName of the directory
Correct Answer: Option C
Note: null
MCQ 169Understanding Computer Files
A scanner object can be created from _______________
Aa string
Bfile object
CInputStream object
DA or B or C
Correct Answer: Option D
Note: null
MCQ 170Understanding Computer Files
Which of the following editor is used to create text file?
AVi
BPico
CGedit
DAll of the given
Correct Answer: Option D
Note: null
MCQ 171Understanding Computer Files
___________ method of file class returns the name of file or directory referred by the object.
AString get( )
BString getName( )
CString getFile( )
DString Name( )
Correct Answer: Option B
Note: null
MCQ 172Understanding Computer Files
Which of the following is required to create in order to use class and methods of FileOutputStream?
AFile object
BOutput object
COutput stream
DNone of the given
Correct Answer: Option A
Note: null
MCQ 173Understanding Computer Files
Which method of scanner class returns true if there is a token in input?
Astring close( )
Bvoid close( )
CBoolean hasNext()
Dint next()
Correct Answer: Option C
Note: null
MCQ 174Understanding Computer Files
For which of the following reason/s the constructor of FileOutputStream can throw FileNotFoundException?
AFile does not exist.
BIf the file name refers to directory rather than a regular file.
CFile cannot be opened for some reason.
DA or B or C Compiled
Correct Answer: Option D
Note: null
MCQ 175Understanding Computer Files
_________________ are used to read and write 16-bit unicode characters.
ACharacter stream classes
BByte stream classes
CBoth A and B
DNone of the given
Correct Answer: Option A
Note: null
MCQ 176Stream Classes in Java
which class has a special feature that is breaks the input string into tokens using a delimiter ?
Ascaner
Bdate
Ccalander
Dstream
Correct Answer: Option A
Note: GSEB Commerce Oct-2020
MCQ 177Character Stream Classes
For character stream classes,which packageย is available for a group of classes ?
Ajava.util
Bjava.io
Cjava.lang
Djava.util.Arrays
Correct Answer: Option B
Note: GSEB Commerce Oct-2020
MCQ 178Console Class
Which class can be used to get input from the keyboard and the input is to be typed in hidden form ?
AScanner
BConsole
CStream
DDate
Correct Answer: Option B
Note: GSEB Commerce Oct-2020
MCQ 179Scanner Class
Which of the following method does not belong ย to scanner class?
AString nextLine ()
Bint nextInt()
Cfloat nextFloat ()
Dint read()
Correct Answer: Option D
Note: GSEB Commerce Oct-2020
MCQ 180Methods of File Class
In file class of java, which method is used to return the name of file and directory in a directory?
AString getName ()
BString getPath ()
CString ย []list ()
DString getAbsolutePath ()
Correct Answer: Option C
Note: GSEB Commerce Oct-2020
MCQ 181Understanding Computer Files
What do we call the storage where values stored in variables are lost when a computer is shutdown?
AVolatile storage
BNon- volatile
CAccess storage
DBoth a and b
Correct Answer: Option A
Note: S-March-2020
MCQ 182Understanding Computer Files
There are โฆโฆโฆโฆโฆmethods of โfile classโ that can be used to perform various operations on a file or directory.
A10
B20
C30
D40
Correct Answer: Option C
Note: S-March-2020
MCQ 183Understanding Computer Files
In Linux. "passwdโ file present in which directory?
Aetc
Bin
Croot
Dpwd
Correct Answer: Option A
Note: S-March-2020
MCQ 184Understanding Computer Files
A โฆโฆ.. is an abstract representation of an input or output device that is used as a source or destination for data.
AStream
BBinary
CFile
DDirectory
Correct Answer: Option A
Note: S-March-2020
MCQ 185Understanding Computer Files
In Java, which method of file writer class writes the lower 16 bits of โcโ to the stream?
Avoid write (int c)
Bvoid write (string s)
Cboolean write (int c)
Dstring (write (int c)
Correct Answer: Option A
Note: G-March-2022
MCQ 186Understanding 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?
Ajava.util. Scanner
Bjava.util.Console
Cjava.io.Console
Djava.io.File Reader
Correct Answer: Option C
Note: G-March-2022
MCQ 187Understanding Computer Files
In Java, which method of scanner class, scans the next token of the input as Line?
Astring next( )
Bboolean hasNext ( )
Cint next Line ( )
Dstring nextLine ( )
Correct Answer: Option D
Note: G-March-2022
MCQ 188Understanding Computer Files
Which class of Java can be used to access attributes of files like file permissions, length of a file, last modification time?
AWriter Class
BFile Class
CScanner Class
DConsole Class
Correct Answer: Option B
Note: G-March-2022
MCQ 189Understanding 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?
AText files
BBinary files
CImage files
DAudio files
Correct Answer: Option A
Note: G-March-2022
MCQ 190Understanding Computer Files
In Java, which method of file class returns an array of abstract path names denoting the files in the directory?
AString[ ] list( )
Blong length( )
CFile [ ] listFiles ( )
Dstring getPath( )
Correct Answer: Option C
Note: G-March-2022
MCQ 191Stream Classes in Java
Which class defines the functionality that is available for all character input streams?
Avoid reader class
BExact reader class
CAbstract reader class
DSuper reader class
Correct Answer: Option C
Note: S-March-2020
MCQ 192Character Stream Classes
Which of the following format is used in Java to store a character?
AASCII
BUnicode
CBoth (A) and (B)
DNone of these
Correct Answer: Option C
Note: S-March-2020
MCQ 193Stream Classes in Java
FROM THE FOLLOWING WHICH ARE THE TYPES OF STREAM CLASS IN JAVA.
ACharacter Stream
BByte Steam
CBoth a and b
DBoolean Stream
Correct Answer: Option C
Note: null
MCQ 194Methods of File Class
FILE METHOD BOOLEN IS FILE() RETURNS WHICH TYPE OF VALUE OF FILE CLASS?
ATRUE OR FALSE
BYES OR NO
C0 OR 1
DY OR N
Correct Answer: Option A
Note: null
MCQ 195Scanner Class
WHICH OF THE FOLLOWING IS USED AS A SEPARATOR BETWEEN FIELDS OF RECORD?
AVARIABLE
BSPACE
CPATH
DDELIMITER
Correct Answer: Option D
Note: null
MCQ 196Understanding Computer Files
Write down some common extensions of text file.
A.txt
B.java
C.c
DAll of these
Correct Answer: Option D
Note: null
MCQ 197Understanding Computer Files
Which type of file contains data that has not been encoded as text?
AText file
BBinary file
CImage file
DVideo file
Correct Answer: Option B
Note: null
MCQ 198Understanding Computer Files
Which of the following way to provide file reference to the File Class?
Aabsolute path
Brelative path in string format
Cdirectory
Dboth a and b
Correct Answer: Option D
Note: null
MCQ 199Understanding Computer Files
Which of the following stream can transfer data from keyboard or from the file on a hard disk to the program?
Ainput stream
Boutput stream
Cfile stream
Ddirectory stream
Correct Answer: Option A
Note: null
MCQ 200Understanding Computer Files
Which of the right syntax to create an object of FileWriter class?