41. What happens when you don’t handle an exception? abruptly. O The program encounters eror and simply ignores it. O A message is printed to the console to ask you how to handle the error. OAll of the code after the error is skipped, but the program still runs 42. An exception is an error that occurs during the execution of a program at run-time that disrupts the normal flow of the Java program. True O False n 9 all questions in this section) 43. When you write code for MouseEvents, you are telling a Node to listen for a particular event True O False 44. JavaFX doesnt provide you with UI elements, shapes and text. So you must always create your own graphics True O False 45. An Image is an object that describes the location of a graphics file. True O False
Expert Answer
41. What happens when you don’t handle an exception?
Ans. The execution of the program is terminated abruptly.
Explanation : When we dont handle runtime exception explicitly, the exception causes the program to terminate abnormally as soon as an exception is encountered as it searches for the code to handle it and is not able to find it.
42. An exception is an error that occurs during execution of the program at the run time that disrupts the normal flow of the Java program.
Ans. True
Explanation : Errors that occur during runtime of a java program is known as Exception. Unhandled exceptions results in abnormal termination of the program.
43. When you write the code for MouseEvents, you are telling a Node to listen for a particular event.
Ans. True
Explanation : the MouseEvent codes tells the node to listen for a particular event that is mouse click.
44. JavaFX doesn’t provide you with UI elements, shapes and text. So you must always create your own graphics.
Ans. False
Explanation : JavaFX provides us with a variety of graphics and shapes which can be used while creating a application
45. An Image is an object that describes the location of a graphics file.
Ans. True
Explanation : An Image object stores the URL of the graphics file.
46. What is the correct syntax to instantiate a JavaFX Rectangle?
Ans. Rectangle rect = new Rectangle(20,20,100,200);
Explanation : Syntax – Rectangle(double x, double y, double width, double height)
this creates a Rectangle at a given position with given size.
47. JavaFX Ensemble contains code examples of JavaFX features.
Ans. True
Explanation : Javafx ensemble is a collection of more than 100’s of sample application which uses a variety of javafx features.
48. Which is not a JavaFX Node.
Ans. Object
Explanation : Object is the super class of javafx.scene.Node
49. A layout Pane dictates how Nodes must be positioned.
Ans. True.
Explanation : Layout Pane of JavaFx Application defines how the nodes must be positioned in an application.
Below are some of the Layout Panes :
HBox : arranges all the nodes horizontally
VBox : arranges all the nodes vertically
BorderPane : arranges all the nodes at top, bottom, left, right and center of application.
50. The start() method is the entry point for all JavaFX Application.
Ans. True.
Explanation : Application class must be inherited and the start method must be implemented to created a JavaFX Application. This start method will contain all the code for JavaFX design and graphics.
Now in main main method we call launch method which internally calls start method.
So for a JavaFX Application start method of Application class is the entry point.