• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 3 out of 22 pages
Exam (elaborations)

CS1102 || with 100% Correct Answers.

Document preview thumbnail
Preview 3 out of 22 pages

Which one of the following types is not allowed for the expression in a switch statement? a. enum b. float c. int d. long correct answers enum Which of the following can a class NOT be used for? a. a container for static methods (subroutines) b. a container for static variables c. a primitive type d. a type for method parameters e. a type for variables correct answers a type for variables

Content preview

CS1102 || with 100% Correct Answers.


Which one of the following types is not allowed for the expression in a switch statement?
a.
enum
b.
float
c.
int
d.
long correct answers enum


Which of the following can a class NOT be used for?
a.
a container for static methods (subroutines)
b.
a container for static variables
c.
a primitive type
d.
a type for method parameters
e.
a type for variables correct answers a type for variables


What is the output of the following Java program?
class Food { void flavor() { System.out.println("bland"); } } class Pepper extends Food { void
flavor() { System.out.println("spicy"); } } public class Lunch { public static void main(String[]
args) { Food lunch = new Pepper(); lunch.flavor(); } }

,a.
bland
b.
bland
spicy
c.
no output
d.
spicy
e.
the program does not compile correct answers bland
spicy


Consider the following first line from a Java method definition.public static boolean compute(int
n, float x) {Which one of the following lines could begin a method that legally overloads the
above method?
a.
private static boolean compute(int n, float x) {
b.
public boolean compute(int n, float x) {
c.
public static int compute(int n, float x) {
d.
public static boolean compute(float n, int x) {
e.
public static boolean compute(int x, float n) { correct answers b.
public boolean compute(int n, float x) {

, 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);
}
}
a.
import javafx.scene.control.Button;
b.

Document information

Uploaded on
July 7, 2025
Number of pages
22
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$14.19

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

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.
SirAnton
3.7
(118)
Sold
811
Followers
438
Items
40067
Last sold
1 day ago




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