Object Oriented Programming - I (3140705) MCQ
Object Oriented Programming - I (3140705) MCQ
A. Prism C. Webview
B. Scene Graph D. Browser
Answer: d. Browser
A. UI Controls C. Prism
B. Stage D. None of these
Answer: a. UI Controls
4 Prism is _______
A. Scene ‐> Scene Graph ‐> Stage C. Scene Graph ‐> Scene ‐> Stage
B. Stage ‐> Scene ‐> Scene Graph D. None of these
Answer: b. Stage ‐> Scene ‐> Scene Graph
A. Decorated C. Transparent
B. Opaque D. Utility
Answer: b. Opaque
A. Group C. Shape
B. Region D. Webview
Answer: c. Shape
A. Scene C. Group
B. Stage D. Application
Answer: d. Application
A. start C. load
B. run D. scene
Answer: a. start
A. Node C. Scene
B. Stage D. Group
Answer: b. Stage
A. init C. update
B. start D. stop
Answer: c. update
13 Width and height arguments are optional in the constructor of Scene class.
A. TRUE C. 0
B. FALSE D. 0
Answer: a. TRUE
A. addScene C. showScene
B. setScene D. loadScene
Answer: b. setScene
A. setStartX C. getLength
B. getStartX D. toString
Answer: c. getLength
A. setArcWidth C. setHeight
A. javafx.scene.image C. javafx.image
B. javafx.scene.imageView D. javafx.scene.image.imageView
Answer: a. javafx.scene.image
19 The _____ layout arranges all the nodes in our application in a single horizontal row.
A. VBox C. HBox
B. FlowPane D. TilePane
Answer: c. HBox
20 The _____ layout arranges all the nodes in our application in a single vertical column.
A. VBox C. HBox
B. FlowPane D. TilePane
Answer: a. VBox
21 The _____ layout arranges the nodes in our application in top, left, right, bottom and center positions.
A. TilePane C. GridPane
B. BorderPane D. FlowPane
Answer: b. BorderPane
22 The _____ layout arranges the nodes in our application on top of another.
A. TilePane C. StackPane
B. BorderPane D. FlowPane
Answer: c. StackPane
A. FlowPane C. BorderPane
B. GridPane D. TextFlow
Answer: d. TextFlow
24 The _____ layout anchors the nodes in our application at a particular distance from the pane.
A. GridPane C. BorderPane
B. AnchorPane D. TextFlow
Answer: b. AnchorPane
25 The _____ layout adds all the nodes of application in the form of uniformly sized tiles.
A. TilePane C. BorderPane
B. GridPane D. AnchorPane
Answer: a. TilePane
26 The _____ layout arranges the nodes in our application as a grid of rows and columns.
A. TilePane C. BorderPane
B. GridPane D. AnchorPane
Answer: b. GridPane
Prepared By:BDC Page 3 of 10
Object Oriented Programming ‐ I (3140705) MCQ.xlsx OBJECTIVE QUESTION BANK
A. TilePane C. StackPane
B. BorderPane D. FlowPane
Answer: d. FlowPane
29 In event capturing phase, event travels to all nodes in top to bottom manner.
31 Inner class can access all the members of outer class including private data members and methods.
A. TRUE C. 0
B. FALSE D. 0
Answer: A. TRUE
A. TextField C. TextArea
B. Label D. EditTextView
Answer: b. Label
A. Label C. Label
B. Label D. All of them
Answer: d. All of them
34 _____ enables an application to have some action executed when the application user clicks the button.
A. Button C. RadioButton
B. CheckBox D. Slider
Answer: a. Button
A. ButtonEvent C. MouseEvent
B. ActionEvent D. ClickEvent
Answer: b. ActionEvent
A. ComboBox C. CheckBox
B. TextField D. RadioButton
Answer: c. CheckBox
A. CheckBox C. 0
B. CheckBox D. 0
Answer: a. CheckBox
A. List C. RadioButton
B. ComboBox D. CheckBox
Answer: c. RadioButton
A. TextArea C. Label
B. EditTextView D. TextField
Answer: d. TextField
A. getText C. enteredText
B. text D. textEntered
Answer: a. getText
A. TextArea C. Label
B. EditTextView D. TextField
Answer: a. TextArea
44 _____ is a typical element of a user interface that enables users to choose one of several options.
A. CheckBox C. CheckBox
B. TextField D. ComboBox
Answer: d. ComboBox
______ displays a horizontal or vertical list of items from which the user may select, or with which the user
45
may interact.
A. TextArea C. ListView
B. ComboBox D. CheckBox
Answer: c. ListView
46 _____ is used to provide a scroll bar to the user so that the user can scroll down the application pages.
A. Slider C. List
B. ScrollBar D. ScrollView
Answer: b. ScrollBar
A. setMin C. setValues
B. setMax D. setSize
Answer: d. setSize
_____ is used to display a continuous or discrete range of valid numeric choices and allows the user to
48
interact with the control.
A. Slider C. List
B. ScrollBar D. ScrollView
Answer: a. Slider
A. Slider C. Slider
B. Slider D. None of them
Answer: c. Slider
50 Which of these packages contain classes and interfaces used for input & output operations of a program?
A. java.util C. java.io
B. java.lang D. all of the mentioned
Answer: c. java.io
A. String C. Writer
B. StringReader D. File
Answer: a. String
A. DataInput C. ObjectFilter
B. ObjectInput D. FileFilter
Answer: c. ObjectFilter
53 Which of these class is not related to input and output stream in terms of functioning?
A. File C. InputStream
B. Writer D. Reader
Answer: a. File
55 Which of these is method for testing whether the specified element is a file or a directory?
A. IsFile C. Isfile
B. isFile D. isfile
Answer: b. isFile
What will be the output of the following Java code? import java.io.*; class files { public sta c void
56
main
A. java C. java/system
B. system D. /java/system
Answer: b. system
A. java C. java/system
B. system D. javasystem
Answer: d. javasystem
59 Which of these classes is used for input and output operation when working with bytes?
A. InputStream C. Writer
B. Reader D. All of the mentioned
Answer: a. InputStream
A. FileReader C. FileInputStream
B. FileWriter D. InputStreamReader
Answer: c. FileInputStream
61 Which of these method of InputStream is used to read integer representation of next available byte input?
A. read C. get
B. scanf D. getInteger
Answer: a. read
A. int C. byte
B. float D. none of the mentioned
Answer: d. none of the mentioned
63 Which of these is a method to clear all the data present in output buffers?
A. clear C. fflush
B. flush D. close
Answer: b. flush
A. put C. printf
B. print D. write
Answer: b. print
66 Which of these stream contains the classes which can work on character stream?
A. FileReader C. FileInputStream
B. FileWriter D. InputStreamReader
Answer: a. FileReader
68 Which of these method of FileReader class is used to read characters from a file?
A. read C. get
B. scanf D. getInteger
Answer: a. read
69 Which of these class can be used to implement the input stream that uses a character array as the source?
A. BufferedReader C. CharArrayReader
B. FileReader D. FileArrayReader
Answer: c. CharArrayReader
72 These are commonly used methods of _____ class ) public abstract int read
73 Which is used as an internal buffer to add more efficienctly than to write data directly into a stream?
A. BufferedOutputStream C. BufferedInputStream
B. ByteArrayOutputStream D. ByteArrayInputStream
Answer: a. BufferedOutputStream
74 Which classes does Oracle has suggested not to use if you have to read and write the textual information?
BufferedInputStream and
A. C. FileInputStream and FileOutputStream
BufferedOutputStream
SequenceInputStream and
B. D. Both A & B
SequenceOutputStream
Answer: c. FileInputStream and FileOutputStream
A. InputStreamReader C. DataInputStream
B. Console D. All Mentioned above
Answer: d. All Mentioned above
A. Console C. InputStreamReader
B. Scanner D. DataInputStream
78 Which class automatically flushes the data so there is no need to call flush
80 To achieve performance, the DataInputStream class comes with some special methods like?
A. WriteDouble C. WriteBytes
81 Which method of DataInputStream class reads a line from the file and returns it as a string ?
A. WriteInt C. readInt
B. readLine D. writeDouble
Answer: b. readLine
Java application uses an output stream to read data from a source, it may be a file, an array, peripheral device
82
or socket?
A. TRUE C. TRUE
B. FALSE D. 0
Answer: b. FALSE