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 Programming Self Quiz 6 Answers- University of the People 2022

Rating
-
Sold
-
Pages
15
Grade
A
Uploaded on
15-08-2022
Written in
2022/2023

CS 1102 Programming Self Quiz 6 Answers- University of the People 2022/CS 1102 Programming Self Quiz 6 Answers- University of the People 2022/CS 1102 Programming Self Quiz 6 Answers- University of the People 2022/CS 1102 Programming Self Quiz 6 Answers- University of the People 2022/CS 1102 Programming Self Quiz 6 Answers- University of the People 2022/CS 1102 Programming Self Quiz 6 Answers- University of the People 2022

Show more Read less
Institution
Course

Content preview

Question 1
Correct
Mark 1.00 out of 1.00




Flag question

Question text

Consider the following Java program. Which one of the following is an interface?


import java.awt.event.*;
import javax.swing.*;
public class MouseWhisperer extends JFrame implements MouseListener {
MouseWhisperer() {
super("COME CLOSER");
setSize(300,100);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
addMouseListener(this);
setVisible(true);
}
public void mouseClicked(MouseEvent e) { setTitle("OUCH"); }
public void mousePressed(MouseEvent e) { setTitle("LET GO"); }
public void mouseReleased(MouseEvent e) { setTitle("WHEW"); }
public void mouseEntered(MouseEvent e) { setTitle("I SEE YOU"); }
public void mouseExited(MouseEvent e) { setTitle("COME CLOSER"); }
public static void main(String[] args) { new MouseWhisperer(); }
}

Select one:

a. java.awt.event

b. JFrame

c. MouseEvent

d. MouseListener



e. this

Feedback

Your answer is correct.
See Section 6.3.1.
The correct answer is: MouseListener

, Question 2
Correct
Mark 1.00 out of 1.00




Flag question

Question text

Consider the following Java program. What is the superclass of "Clicker"?
import java.awt.event.*;
import javax.swing.*;
public class Clicker extends JFrame implements ActionListener {
int count;
JButton button;
Clicker() {
super("Click Me");
button = new JButton(String.valueOf(count));
add(button);
button.addActionListener(this);
setSize(200,100);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
}
public void actionPerformed(ActionEvent e) {
count++;
button.setText(String.valueOf(count));
}
public static void main(String[] args) { new Clicker(); }
}

Select one:

a. ActionEvent

b. ActionListener

c. JButton

d. JFrame



e. this

Feedback

Your answer is correct.
See Section 5.5.2.

Written for

Course

Document information

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

Subjects

$16.48
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.
Timeless2024 Chamberlain College Nursing
Follow You need to be logged in order to follow users or courses
Sold
3667
Member since
6 year
Number of followers
3135
Documents
2172
Last sold
1 month ago
Email/DM Me for the LATEST REVISED Exams, Study Guides, Assignments, Quizzes etc. @

Number one Stop Shop for Study Guides, Exams, Assignments, Test Banks etc 2023/2024

3.9

683 reviews

5
342
4
127
3
105
2
41
1
68

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