
Java Programming
Authored by undefined Nur Shamilla Binti Selamat
Computers
University
Used 4+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
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
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
25 questions
Quiz Bootstrap (Fullstack Praktikum)
Quiz
•
University
25 questions
Module 3 - Security Architecture
Quiz
•
University
25 questions
Algorithms are not magic - AQA A Level Computer Science
Quiz
•
8th Grade - University
25 questions
Aptitude Competition(FY)
Quiz
•
University
25 questions
QUIZ 4
Quiz
•
University
25 questions
Solutions. Test on un5 (Techn, modal perfect,quantifiers)
Quiz
•
9th Grade - University
25 questions
Metro 1
Quiz
•
University
25 questions
Atividade sobre Modelos de Processo de Software
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade