1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
liubo4ka [24]
3 years ago
14

True or False. When clicking the button, the program displays OK1 OK2. When clicking the button, the program displays OK1. When

clicking the button, the program displays OK2. The program has a compile error, because the setOnAction method is invoked twice.
Computers and Technology
1 answer:
zaharov [31]3 years ago
8 0

Answer:

False, The program has no compile error.

Explanation:

import javafx.application.Application;

import javafx.scene.Scene;

import javafx.scene.control.Button;

import javafx.stage.Stage;

public class Test extends Application {

 @Override // Override the start method in the Application class

 public void start(Stage primaryStage) {

   // Create a button and place it in the scene

   Button btOK = new Button("OK");

   btOK.setOnAction(e -> System.out.println("OK 1"));

   btOK.setOnAction(e -> System.out.println("OK 2"));

   Scene scene = new Scene(btOK, 200, 250);

   primaryStage.setTitle("MyJavaFX"); // Set the stage title

   primaryStage.setScene(scene); // Place the scene in the stage

   primaryStage.show(); // Display the stage

 }

 public static void main(String[] args) {

   launch(args);

 }

}

Java has an inline compiler, so if the line of code for an event is repeated twice and they both are not segmented, they will be compiled consecutively.

You might be interested in
8.5 question 2 edhesive
dangina [55]

Answer:

Please check the attachment.

Explanation:

Please check the attachment for the program in python.

Download txt
5 0
3 years ago
Print "Censored" if userInput contains the word "darn", else print userInput. End with newline. Ex: If userInput is "That darn c
barxatty [35]

Answer:

#include <string>

#include <iostream>

using namespace std;

int main() {

string userInput;

getline(cin, userInput);

// Here, an integer variable is declared to find that the user entered string consist of word darn or not

int isPresent = userInput.find("darn");

if (isPresent > 0){

cout << "Censored" << endl;

// Solution starts here

else

{

cout << userInput << endl;

}

// End of solution

return 0;

}

// End of Program

The proposed solution added an else statement to the code

This will enable the program to print the userInput if userInput doesn't contain the word darn

6 0
3 years ago
Write a program to solve the selection problem. Let k = N/2. Draw a table showing the running time of your program for various v
Brums [2.3K]
So here is the code in Python:

n = 0.00 #this is a float because there are some numbers that are decimals.

while n < 20: #n which is 0.00 and while it is lower than 20 if runs the code below
n = n + 1 #it will add 1 to n everything it runs the code.
k = n / 2 #it will divide whatever n is everytime by 2
print(str(n) + '/2: ') # it's printing the number it's on
print(k) # prints the answer for the n.

You can change n to add by any, make n any num instead of 0.00 and you can change the while condition from n < 20 to any other logical statement. If you want to get creative you can take 2 inputs for numbers and make one of them the starting number and other one is the ending number. Also make sure to make n a number lower than you starting point because if you set n as your starting point then it will skip it.

4 0
3 years ago
Read each example from the opening of a speech on the topic of video gaming. Identify the type of hook being used According to a
skelet666 [1.2K]

Answer:

it goes c, b, b, a

Explanation:

6 0
3 years ago
A user cannot connect to any devices outside of the current network. Which device should a technician check first for problems?
tatiyna

Answer:

DHCP server

Explanation:

The first option that we must check is the DHCP server (The Dynamic Host Configuration Protocol) server because this is the protocol that gives us the IP addresses to connect with the internet if we don't have an IP (Internet Protocol) address,  we can never have an internet connection, if the DNS fails we cannot connect with the internet, but regularly the DHCP is the main issue if there are not physical issues.

4 0
3 years ago
Other questions:
  • Melissa is the network administrator for a small publishing company. as network administrator, she is in charge of maintaining t
    8·1 answer
  • What kinds of online behaviors could be considered cyberbullying?
    7·2 answers
  • Which is a description of phishing?
    7·1 answer
  • Mary from sales is asking about the plan to implement Salesforce.com's application. You explain to her that you are in the proce
    9·1 answer
  • Which of the following statements is TRUE?
    11·1 answer
  • Which os the following is NOT true about the proof of work concept?
    8·1 answer
  • k-means clustering cannot be used to perform hierarchical clustering as it requires k (number of clusters) as an input parameter
    15·1 answer
  • Atheel tests a program and gets a NameError. How can this be fixed?
    13·2 answers
  • write a c program to insert and delete values from stack( to perform pop and push operations) using an array data structure
    8·1 answer
  • Abby has received a request for a data set of actual data for testing a new app that is being developed. She does not want the s
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!