Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

CS 1102 FINAL EXAM QUIZ- Programming 2023/2024

Rating
-
Sold
-
Pages
25
Grade
A+
Uploaded on
10-08-2023
Written in
2023/2024

CS 1102 FINAL EXAM QUIZ- Programming 2023/2024CS 1102 FINAL EXAM QUIZ- Programming 2023/2024CS 1102 FINAL EXAM QUIZ- Programming 2023/2024CS 1102 FINAL EXAM QUIZ- Programming 2023/2024CS 1102 FINAL EXAM QUIZ- Programming 2023/2024CS 1102 FINAL EXAM QUIZ- Programming 2023/2024

Show more Read less
Institution
Course

Content preview

Consider the following Java program. Which statement registers an object to
receive events?
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.application.Platform;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.HBox;
import javafx.scene.control.Button;
public class TestFX extends Application {
public void start(Stage stage) {
Button quitButton = new Button("Quit");
quitButton.setOnAction(e -> Platform.exit());
HBox buttonBar = new HBox(quitButton);
BorderPane root = new BorderPane();
root.setBottom(buttonBar);
Scene scene = new Scene(root, 100, 50);
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch(args);
}
}

Select one:

a.
import javafx.scene.control.Button;


b.
Button quitButton = new Button("Quit");


c.
quitButton.setOnAction(e -> Platform.exit());

,d.
root.setBottom(buttonBar);


e.
stage.setScene(scene);
Feedback
Your answer is correct.
Which of the following should be used to compare the contents of two String
objects in Java?

Select one:

a.
=


b.
==


c.
cmp


d.
equals


e.
?
Feedback
Your answer is correct.
Which one of the following is used in Java programming to handle
asynchronous events?
Select one:

a.
event handlers


b.
pragmatics

, c.
protocols


d.
reserved words


e.
short circuits
Feedback
Your answer is correct.
Which of the following keywords is useful for getting out of an infinite loop?
Select one:

a.
break


b.
continue


c.
do


d.
switch


e.
while
Feedback
Your answer is correct.
What is the output of the following Java program?

import java.util.*;
class ArrayGames {
public static void main(String[] args) {
int[] a = {1,2,3,4,5};
for (int i = 0; i < a.length; i++) a[i] = a[i-1];
System.out.println(Arrays.toString(a));

Written for

Course

Document information

Uploaded on
August 10, 2023
Number of pages
25
Written in
2023/2024
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$21.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
VEVA2K Self
Follow You need to be logged in order to follow users or courses
Sold
2850
Member since
5 year
Number of followers
2413
Documents
4280
Last sold
1 hour ago
Affordable, Up-to-date-Quality Nursing Papers

Here, you'll find a wide range of Nursing Papers at an affordable rate. Every student deserves a friendly environment for study. Always message me for any concern and help. My email is

4.1

688 reviews

5
378
4
128
3
101
2
24
1
57

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions