
Java Programming

Quiz
•
Computers
•
University
•
Medium

undefined Nur Shamilla Binti Selamat
Used 4+ times
FREE Resource
30 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct syntax to create a button using Java Swing?
Button button = new Button();
JButton button = new JButton();
JLabel button = new JLabel();
JFrame button = new JFrame();
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct syntax to add a button to a frame in Java GUI?
frame.add(button);
button.add(frame);
new Button().add(frame);
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct syntax to set the text of a button in Java GUI?
button.setText("Hello, world!");
new Button("Hello, world!");
button.setLabel("Hello, world!");
button.setTitle("Hello, world!");
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct syntax to create a label in Java GUI?
Label label = new Label();
JButton label = new JButton();
JFrame label = new JFrame();
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct syntax to add a label to a frame in Java GUI?
frame.add(label);
label.add(frame);
new Label().add(frame);
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is not an exception handling keyword in Java?
try
catch
finally
if
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the try block in exception handling?
To execute a block of code that may throw an exception
To catch an exception and handle it
To execute a block of code that must be executed, regardless of whether an exception is thrown
To close all resources that were opened in the try block
Create a free account and access millions of resources
Similar Resources on Wayground
26 questions
Java Programming Quiz

Quiz
•
University
25 questions
PHP

Quiz
•
University
25 questions
C Programming Language Quiz

Quiz
•
University
30 questions
CYBERCREST - 2K24_TECHNICAL QUIZ_ROUND 1 SET 2

Quiz
•
University
25 questions
Mock 2nd MCQ Python

Quiz
•
University
25 questions
Lenguajes programación

Quiz
•
10th Grade - University
33 questions
CS26 L 2ND EXAM PRACTICE

Quiz
•
University
25 questions
U5. Spring

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Would you rather...

Quiz
•
KG - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
10 questions
The Constitution, the Articles, and Federalism Crash Course US History

Interactive video
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
16 questions
Water Modeling Activity

Lesson
•
11th Grade - University
10 questions
ACT English prep

Quiz
•
9th Grade - University