wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Brewing JavaFX Quiz

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

Which of the following is not a Valid Comment?

a)

/ / comment

b)

/ * comment

c)

/ * comment * /

d)

/ * * comment * /

2.

What is the purpose of the "main" method in Java?

a)

To display output

b)

To start the execution of a Java program

c)

To perform calculations

d)

To create an instance of an object

3.

Operators maybe used in building _____ which compute values.

a)

Operands

b)

Impressions

c)

Expressions

d)

Operations

4.

A blueprint for a software object is called a ____.

a)

Modifier

b)

Object

c)

Method

d)

Class

5.

What is the Java Virtual Machine (JVM)?

a)

A library for Java code

b)

A runtime environment for Java code

c)

An interpreter for Java code

d)

A compiler for Java code

6.

Which one of the following is platform dependent?

a)

JavaFX

b)

Swing

c)

AWT

d)

Java

7.

Layout section which is used to specify position of components, is situated in which of the following panels?

a)

Inspector panel

b)

Modify panel

c)

Library panel

d)

Structure panel

8.

Which of the following best describes the relationship between Stage, Scene, and Scene graph in JavaFX?

a)

Stage is the root container that contains all the visual elements, Scene is a container for UI controls, and Scene graph is a tree-like structure that represents the elements in the Scene

b)

Stage is a container for UI controls, Scene is a root container that contains all the visual elements, and Scene graph is a tree-like structure that represents the elements in the Stage.

c)

Stage is a tree-like structure that represents the elements in the Scene, Scene is a container for UI controls, and Scene graph is the root container that contains all the visual elements

d)

Stage is a container for UI controls, Scene is a tree-like structure that represents the elements in the Scene, and Scene graph is the root container that contains all the visual elements.

9.

 Different panes are available in the scene builder library. Which of the following is not one of them?

a)

Anchor pane

b)

Border pane

c)

Grid pane

d)

Window pane

10.

What is FXML in JavaFX?

a)

A library for creating user interfaces

b)

A markup language for defining JavaFX user interfaces

c)

A programming language

d)

JavaFX Editor

11.

Consider the following code snippet.

if( ! other.isSelected() )

{

System.out.println("Other is selected");

}

System.out.println("Other is not selected");

What will be the output if the radio button 'other' is selected?

a)

Other is selected

Other is not selected

b)

Prints nothing

c)

Other is not selected

d)

Other is selected

12.

The _____ includes tools for developing and testing programs written in the Java programming language and running on the Java platform.

a)

JDK

b)

SDK

c)

IDE

d)

JPK

13.

What does the Initializable in JavaFX do?

a)

Initializes variables

b)

Registers event handlers

c)

Initializes the components of a scene

d)

Runs automatically when a scene is created

14.

What does @FXML annotation in JavaFX do?

a)

It is used to initialize variables and objects.

b)

It is used to bind data to user interface controls.

c)

It is used to define event handlers for user interface controls.

d)

All of the above.

15.

What do the setText() and getText() methods in JavaFX do?

a)

Set and get the background color of a node

b)

Set and get the font of a node

c)

Set and retrieve the text of a node

d)

Set and get the size of a node