Questions · Page 1 of 5

MCQ

🎯

Test yourself on this topic

50 questions · timed · auto-graded

MCQ 11 Mark
Which class is used to input data from the keyboard?
  • A
    Console
  • B
    Scanner
  • a and b both
  • D
    Reader
Answer
Correct option: C.
a and b both
a and b both
View full question & answer
MCQ 21 Mark
Which class is used to input data in hidden from the keyboard?
  • Console
  • B
    Scanner
  • C
    Reader
  • D
    Input
Answer
Correct option: A.
Console
Console
View full question & answer
MCQ 31 Mark
Which class is used to access data from a file?
  • A
    Console
  • Scanner
  • C
    Reader
  • D
    Input
Answer
Correct option: B.
Scanner
Scanner
View full question & answer
MCQ 41 Mark
Which class does Java provide to perform File operations?
  • java.io.File
  • B
    java. File
  • C
    java.File.io
  • D
    java.io.Scanner
Answer
Correct option: A.
java.io.File
java.io.File
View full question & answer
MCQ 51 Mark
Java provides classes to perform operations in the following manner.
  • A
    Sequentially
  • B
    To directly jump to nth record
  • a and b both
  • D
    None of these
Answer
Correct option: C.
a and b both
a and b both
View full question & answer
MCQ 61 Mark
Which of the following classes does Java provide?
  • A
    To store objects
  • B
    To retrieve objects
  • C
    To access a file randomly
  • All of these file
Answer
Correct option: D.
All of these file
All of these file
View full question & answer
MCQ 71 Mark
What happens when password is to be read?
  • A
    The user input will be hidden.
  • B
    The user input is not shown in the console screen.
  • C
    It will return an array of character as the return type.
  • All of these
Answer
Correct option: D.
All of these
All of these
View full question & answer
MCQ 81 Mark
What will be returned as return type while reading the password?
  • A
    Numbers
  • B
    Characters
  • Array of characters
  • D
    Symbols
Answer
Correct option: C.
Array of characters
Array of characters
View full question & answer
MCQ 91 Mark
Which of the following classes provides a method to read a password?
  • A
    Scanner
  • Console
  • C
    Secret
  • D
    Hidden
Answer
Correct option: B.
Console
Console
View full question & answer
MCQ 101 Mark
Which of the following classes is especially used when the input is to be typed in hidden form?
  • A
    Scanner
  • Console
  • C
    Secret
  • D
    Hidden
Answer
Correct option: B.
Console
Console
View full question & answer
MCQ 111 Mark
What is the use of java.io.console ?
  • To get the input from the keyboard.
  • B
    To create different types of object.
  • C
    a and b both
  • D
    None of these
Answer
Correct option: A.
To get the input from the keyboard.
To get the input from the keyboard.
View full question & answer
MCQ 121 Mark
In which of the following Java packages is Console class available?
  • java.io
  • B
    java. Lang
  • C
    java.util
  • D
    java.sc
Answer
Correct option: A.
java.io
java.io
View full question & answer
MCQ 131 Mark
Which of the following classes is used to read from the file?
  • A
    FileReader
  • B
    Scanner
  • C
    Reader
  • a and b both
Answer
Correct option: D.
a and b both
a and b both
View full question & answer
MCQ 141 Mark
Which of the following methods of Scanner class is used to get integer numbers?
  • nextlnt()
  • B
    readlnt()
  • C
    Int()
  • D
    next ()
Answer
Correct option: A.
nextlnt()
nextlnt()
View full question & answer
MCQ 151 Mark
What does the constructor of Scanner class accept to read from Keyboard (Standard input)?
  • System.in
  • B
    System. Out
  • C
    System. Read
  • D
    System. Scan
Answer
Correct option: A.
System.in
System.in
View full question & answer
MCQ 161 Mark
What does the constructor of Scanner class accept as an argument?
  • A
    System. Out
  • System.in
  • C
    System. Read
  • D
    System. Scan
Answer
Correct option: B.
System.in
System.in
View full question & answer
MCQ 171 Mark
Which of the following constructors is used to read from the keyboard by Scanner object?
  • Scanner Kbinput = new Scanner(System.in);
  • B
    Scanner Kbinput= Scanner (System.in);
  • C
    Scanner Kbinput = System.in
  • D
    None of these
Answer
Correct option: A.
Scanner Kbinput = new Scanner(System.in);
Scanner Kbinput = new Scanner(System.in);
View full question & answer
MCQ 181 Mark
Which of the following constructors is used to read from ifie by the Scanner object?
  • Scanner file input = new Scanner (new File (“filename”));
  • B
    file input = new Scanner (new File (“filename”));
  • C
    Scanner file input = Scanner (new File (“filename”));
  • D
    None of these
Answer
Correct option: A.
Scanner file input = new Scanner (new File (“filename”));
Scanner file input = new Scanner (new File (“filename”));
View full question & answer
MCQ 191 Mark
From which of the following objects can Scanner object be created?
  • A
    String
  • B
    File object
  • C
    Input Stream object
  • All of these
Answer
Correct option: D.
All of these
All of these
View full question & answer
MCQ 201 Mark
Which of the following is a constructor of Scanner class?
  • A
    Scanner (String str)
  • B
    Scanner (Input Stream is object)
  • C
    Scanner (FiIe Fobject) throws FileNotFound Exception
  • All of these
Answer
Correct option: D.
All of these
All of these
View full question & answer
MCQ 211 Mark
How can the string “India-1947” be read as?
  • A
    Char-int
  • B
    Array-int
  • String-int
  • D
    Int-it
Answer
Correct option: C.
String-int
String-int
View full question & answer
MCQ 221 Mark
Which is the kind of each token while using Scanner class?
  • A
    Same
  • Different
  • C
    Only two
  • D
    Only three
Answer
Correct option: B.
Different
Different
View full question & answer
MCQ 231 Mark
Which of the following is a generally used symbol in Scanner class?
  • A
    ,
  • B
    .
  • C
    :
  • White Space
Answer
Correct option: D.
White Space
White Space
View full question & answer
MCQ 241 Mark
Into what does the Scanner class break the input string by using delimiter?
  • A
    Symbol
  • Token(Words)
  • C
    ID Number
  • D
    None of these
Answer
Correct option: B.
Token(Words)
Token(Words)
View full question & answer
MCQ 251 Mark
What is used by the Scanner class to break the input string into tokens(words)?
  • A
    Number
  • B
    Alphabet
  • C
    String
  • Delimiter
Answer
Correct option: D.
Delimiter
Delimiter
View full question & answer
MCQ 261 Mark
Which of the following class provides various methods to read input from the keyboard or from the file?
  • A
    Console class
  • B
    Scanner class
  • a and b both
  • D
    Open class
Answer
Correct option: C.
a and b both
a and b both
View full question & answer
MCQ 271 Mark
In which of the following package is Console class available?
  • java.io
  • B
    java.util
  • C
    java.sc
  • D
    java. Lang
Answer
Correct option: A.
java.io
java.io
View full question & answer
MCQ 281 Mark
In which of the following package is Scanner class available?
  • A
    java.io
  • java.util
  • C
    java. Lang
  • D
    java.sc
Answer
Correct option: B.
java.util
java.util
View full question & answer
MCQ 291 Mark
Which of the following techniques is used most widely to take input from the keyboard?
  • A
    Scanner class of javutil package
  • B
    Console class of java.io
  • a and b both
  • D
    None of these
Answer
Correct option: C.
a and b both
a and b both
View full question & answer
MCQ 301 Mark
How many classes are available to take input from the keyboard?
  • Many
  • B
    Five
  • C
    Three
  • D
    Two
Answer
Correct option: A.
Many
Many
View full question & answer
MCQ 311 Mark
What is known as the data given to the computer with the command?
  • A
    File input
  • Command line argument
  • C
    File output
  • D
    None of these
Answer
Correct option: B.
Command line argument
Command line argument
View full question & answer
MCQ 321 Mark
The program can get input of data from live interaction through the following one.
  • KeyboardlGUl
  • B
    Command line argument
  • C
    File
  • D
    All of these
Answer
Correct option: A.
KeyboardlGUl
KeyboardlGUl
View full question & answer
MCQ 331 Mark
From which of the following any program can get input data?
  • A
    Live interaction through Keyboard/GUI
  • As command line argument
  • C
    From files
  • D
    All of these
Answer
Correct option: B.
As command line argument
As command line argument
View full question & answer
MCQ 341 Mark
What is to be applied to convert a data type into another data type?
  • type casting
  • B
    casting
  • C
    type changer
  • D
    type modifier
Answer
Correct option: A.
type casting
type casting
View full question & answer
MCQ 351 Mark
What is to be applied to convert integer to character?
  • type casting
  • B
    casting
  • C
    type changer
  • D
    type modifier
Answer
Correct option: A.
type casting
type casting
View full question & answer
MCQ 361 Mark
Which of the following is generally used to read byte data from the files?
  • FilelnputStream
  • B
    Stream
  • C
    Input
  • D
    Filelnput
Answer
Correct option: A.
FilelnputStream
FilelnputStream
View full question & answer
MCQ 371 Mark
Which of the following is a subclass of Input Stream?
  • FilelnputStream
  • B
    Input
  • C
    Stream
  • D
    Filelnput
Answer
Correct option: A.
FilelnputStream
FilelnputStream
View full question & answer
MCQ 381 Mark
When does the constructor of FileOutputStream throw FileNotFoundException?
  • A
    If the file name refers to directory rather than a regular file.
  • B
    File does not exist.
  • C
    File cannot be opened.
  • All of these
Answer
Correct option: D.
All of these
All of these
View full question & answer
MCQ 391 Mark
Which of the following is a constructor normally used in FileOutputStream?
  • A
    FileOutputStream(String name) throws FileNot FoundException
  • B
    FileOutputStream(File file) throws FileNotFound Exception
  • a and b both
  • D
    None of these
Answer
Correct option: C.
a and b both
a and b both
View full question & answer
MCQ 401 Mark
What can be accepted as a constructor of a FileOutputStream?
  • A
    A string containing the path to the file location
  • B
    Object of the File class
  • a Or b
  • D
    None of these
Answer
Correct option: C.
a Or b
a Or b
View full question & answer
MCQ 411 Mark
“Write” method derived from which abstract class is used to write byte into a file?
  • Output Stream
  • B
    Stream
  • C
    Output
  • D
    File Output
Answer
Correct option: A.
Output Stream
Output Stream
View full question & answer
MCQ 421 Mark
Which of the following statements is true for File Output Stream class?
  • A
    It is a subclass of Output Stream.
  • B
    It is used to write bytes to the file or some output stream.
  • C
    To use this class and its methods, first we need to create a file object, then we could use the write method derived from the abstract class Output Stream to write byte into a file.
  • All of these
Answer
Correct option: D.
All of these
All of these
View full question & answer
MCQ 431 Mark
FilelnputStream class is a subclass of the following class.
  • A
    Input
  • Input Stream
  • C
    file
  • D
    Stream
Answer
Correct option: B.
Input Stream
Input Stream
View full question & answer
MCQ 441 Mark
Which of the following classes of java.io package give us the ability to read and write bytes from and into any files in the disk?
  • A
    FilelnputStream
  • B
    FileOutputStream
  • a and b both
  • D
    None of these
Answer
Correct option: C.
a and b both
a and b both
View full question & answer
MCQ 451 Mark
Which class does Java provide to work with numeric calculations?
  • Binary stream
  • B
    Arithmetic stream
  • C
    Numeric stream
  • D
    Stream
Answer
Correct option: A.
Binary stream
Binary stream
View full question & answer
MCQ 461 Mark
Most of the real life applications are required for the following one.
  • A
    Storing the details of inventory in a file
  • B
    Calculating the costs involved.
  • C
    Storing the employee details and their salaries in a file
  • All of these.
Answer
Correct option: D.
All of these.
All of these.
View full question & answer
MCQ 471 Mark
Which of the following calculations do most of the real life applications require?
  • Numeric
  • B
    Logical
  • C
    Character
  • D
    Relational
Answer
Correct option: A.
Numeric
Numeric
View full question & answer
MCQ 481 Mark
Which of the following package is used to work on characters’ majority?
  • java.io
  • B
    java.util
  • C
    java.string
  • D
    java.lang
Answer
Correct option: A.
java.io
java.io
View full question & answer
MCQ 491 Mark
What is EOF?
  • A
    Ease of file
  • B
    Exit of File
  • End of file
  • D
    Entry on File
Answer
Correct option: C.
End of file
End of file
View full question & answer
MCQ - Computer STD 12 Commerce Questions - Vidyadip