Object Oriented Programming ‐ I (3140705) MCQ.
xlsx OBJECTIVE QUESTION BANK
VVP ENGINEERING COLLEGE, RAJKOT
DEPARTMENT OF COMPUTER ENGINEERING
SUBJECT: Object Oriented Programming - I (3140705) -- SEMESTER 4
T.1 JAVAFX basics and Event-driven programming and animations
T.2 JAVAFX UI controls and multimedia
T.3 Binary I/O ,Recursion and Generics
Question : T.1 1-31, T.2 32-49,T.3 50-82
1 Which is the feauture of JavaFX?
A. FXML C. CSS‐like Styling
B. Scene Builder D. All of them
Answer: d. All of them
2 The following is not the component of JavaFX.
A. Prism C. Webview
B. Scene Graph D. Browser
Answer: d. Browser
3 Scene graph contains the following component.
A. UI Controls C. Prism
B. Stage D. None of these
Answer: a. UI Controls
4 Prism is _______
A. an open graphics library C. a web engine
a high performance hardware–accelerated
B. D. a media engine
graphical pipeline
Answer: b. a high performance hardware–accelerated graphical pipeline
5 GWT provides service to manage
A. rendering Graphics C. Windows, timers or surface
B. Web engine D. Media engine
Answer: c. Windows, timers or surface
6 Which is the correct hierarchy in JavaFX application?
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
7 The following is not the type of Stage.
A. Decorated C. Transparent
B. Opaque D. Utility
Answer: b. Opaque
Prepared By:BDC Page 1 of 10
Object Oriented Programming ‐ I (3140705) MCQ.xlsx OBJECTIVE QUESTION BANK
8 In scene graph, parent node cannot be
A. Group C. Shape
B. Region D. Webview
Answer: c. Shape
9 Which class is extended to make any JavaFX application?
A. Scene C. Group
B. Stage D. Application
Answer: d. Application
10 Which method will called by launch
A. start C. load
B. run D. scene
Answer: a. start
11 Which is the default argument of start
A. Node C. Scene
B. Stage D. Group
Answer: b. Stage
12 Which method is not part of life cycle of JavaFX application?
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
14 Which method is used to add scene to stage?
A. addScene C. showScene
B. setScene D. loadScene
Answer: b. setScene
15 The following is not the method of Line class in javafx.scene.shape
A. setStartX C. getLength
B. getStartX D. toString
Answer: c. getLength
16 Which method is used to make rounded rectangle?
A. setArcWidth C. setHeight
Prepared By:BDC Page 2 of 10
Object Oriented Programming ‐ I (3140705) MCQ.xlsx OBJECTIVE QUESTION BANK
B. setRoundedCorner D. setWidth
Answer: a. setArcWidth
17 Which is the incorrect instantiation of Color class?
A. Color c = Color.web C. Color color = new Color
B. Color c = Color.rgb D. Color c = Color.hsb
Answer: c. Color color = new Color
18 Which package is required to load images in JavaFX?
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
23 The _____ layout arranges multiple text nodes in a single flow.
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
27 The _____ layout wraps all the nodes in a flow.
A. TilePane C. StackPane
B. BorderPane D. FlowPane
Answer: d. FlowPane
28 The following are the phase of event handling in JavaFX
A. Target Selection C. Event Capturing Phase
B. Route Construction D. All of them
Answer: d. All of them
29 In event capturing phase, event travels to all nodes in top to bottom manner.
A. Target Selection C. Event Capturing Phase
B. Route Construction D. Event Bubbling Phase
Answer: c. Event Capturing Phase
30 Event dispatch chain is created in
A. Target Selection C. Event Capturing Phase
B. Route Construction D. Event Bubbling Phase
Answer: b. Route Construction
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
32 _____ is used to display a short text or an image, it is a non‐editable text control.
A. TextField C. TextArea
B. Label D. EditTextView
Answer: b. Label
33 Which of them is correct Label class constructor?
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
35 Which of the following is incorrect Button class constructor?
Prepared By:BDC Page 4 of 10
Object Oriented Programming ‐ I (3140705) MCQ.xlsx OBJECTIVE QUESTION BANK
A. Button C. Button
B. Button D. Button
Answer: b. Button
36 When a button is clicked, the following event is sent.
A. ButtonEvent C. MouseEvent
B. ActionEvent D. ClickEvent
Answer: b. ActionEvent
37 _____ is used to provide more than one choices to the user.
A. ComboBox C. CheckBox
B. TextField D. RadioButton
Answer: c. CheckBox
38 Which of the following is incorrect CheckBox class constructor?
A. CheckBox C. 0
B. CheckBox D. 0
Answer: a. CheckBox
39 Which of the following control is used to implement multiple choice questions?
A. List C. RadioButton
B. ComboBox D. CheckBox
Answer: c. RadioButton
40 Which of the following is correct implementation of RadioButton?
A. RadioButton button1 = new RadioButton C. RadioButton button1 = new RadioButton
B. RadioButton button1 = new RadioButton D. ToggleGroup group = new ToggleGroup
Answer: a. RadioButton button1 = new RadioButton
41 _____ allows a user to enter a single line of unformatted text.
A. TextArea C. Label
B. EditTextView D. TextField
Answer: d. TextField
42 The following method is used to get text from textfield.
A. getText C. enteredText
B. text D. textEntered
Answer: a. getText
Prepared By:BDC Page 5 of 10
Object Oriented Programming ‐ I (3140705) MCQ.xlsx OBJECTIVE QUESTION BANK
43 _____ allows a user to enter multiple lines of plain text.
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
47 Which of the following is not method of ScrollBar class?
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
49 Which of the following is incorrect Slider class constructor?
A. Slider C. Slider
B. Slider D. None of them
Answer: c. Slider
Prepared By:BDC Page 6 of 10
Object Oriented Programming ‐ I (3140705) MCQ.xlsx OBJECTIVE QUESTION BANK
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
51 Which of these class is not a member class of java.io package?
A. String C. Writer
B. StringReader D. File
Answer: a. String
52 Which of these interface is not a member of java.io package?
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
54 Which of these is specified by a File object?
A. a file in disk C. directory in disk
B. directory path D. none of the mentioned
Answer: c. directory in disk
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
57 What will be the output of the following Java program?
A. java C. java/system
B. system D. javasystem
Answer: d. javasystem
58 What will be the output of the following Java program?
A. java true C. java false
Prepared By:BDC Page 7 of 10
Object Oriented Programming ‐ I (3140705) MCQ.xlsx OBJECTIVE QUESTION BANK
B. java false D. java true
Answer: c. java false
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
60 Which of these class is used to read and write bytes in a file?
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
62 Which of these data type is returned by every method of OutputStream?
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
64 Which of these method
A. put C. printf
B. print D. write
Answer: b. print
65 What will be the output of the following Java program?
A. TRUE C. prints number of bytes in file
B. FALSE D. prints number of characters in the file
Answer: c. prints number of bytes in file
66 Which of these stream contains the classes which can work on character stream?
A. InputStream C. Character Stream
B. OutputStream D. All of the mentioned
Answer: c. Character Stream
67 Which of these class is used to read characters in a file?
A. FileReader C. FileInputStream
B. FileWriter D. InputStreamReader
Answer: a. FileReader
Prepared By:BDC Page 8 of 10
Object Oriented Programming ‐ I (3140705) MCQ.xlsx OBJECTIVE QUESTION BANK
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
70 A stream is a sequence of data. In Java a stream is composed of?
A. Bytes C. Both A & B
B. Bits D. None of the above
Answer: a. Bytes
Which stream does Java application uses to read data from a source, it may be a file, an array, peripheral
71
device or socket?
A. InputStream C. Input/OutputStream
B. OutputStream D. None of the above
Answer: a. InputStream
72 These are commonly used methods of _____ class ) public abstract int read
A. OutputStream class C. Input/OutputStream class
B. InputStream class D. None of the above
Answer: b. InputStream class
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
75 Which are the ways to read data from the keyboard?
A. InputStreamReader C. DataInputStream
B. Console D. All Mentioned above
Answer: d. All Mentioned above
76 Which is used to converts the byte‐oriented stream into character‐oriented stream?
A. Console C. InputStreamReader
B. Scanner D. DataInputStream
Prepared By:BDC Page 9 of 10
Object Oriented Programming ‐ I (3140705) MCQ.xlsx OBJECTIVE QUESTION BANK
Answer: c. InputStreamReader
Which class breaks the input into tokens using a delimiter which is whitespace by default? It provides many
77
methods to read and parse various primitive values.
A. Console class C. Both A & B
B. Scanner class D. None of the above
Answer: b. Scanner class
78 Which class automatically flushes the data so there is no need to call flush
A. Console class C. FileInputStream class
B. Scanner Class D. PrintStream class
Answer: d. PrintStream class
79 The PrintStream class provides methods to?
A. read data to another stream C. read data to same stream
B. Write data to another stream D. write data to same stream
Answer: b. Write data to another stream
80 To achieve performance, the DataInputStream class comes with some special methods like?
A. WriteDouble C. WriteBytes
B. WriteInt D. None of the above
Answer: d. None of the above
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
Prepared By:BDC Page 10 of 10