JAVA 1. How do you specify what the program should do when the user clicks a but
ID: 3685662 • Letter: J
Question
JAVA
1. How do you specify what the program should do when the user clicks a button?
2. Which of the following statements about an inner class is true?
3.
Consider the following code snippet:
public class Employee
{
. . .
public void setEmployeeDept(String deptNum)
{
. . .
}
}
public class Programmer extends Employee
{
. . .
public void setEmployeeDept(int deptNum)
{
. . .
}
}
Which of the following statements is correct?
a. Specify the actions to take in a class that implements the ButtonListenerExplanation / Answer
1. when the user clicks a button, then the program will specify the actions to take in a class that implements the Action Listener
so, option (c) is correct
2. The methods of an inner class can access variables declared in the enclosing scope is true for inner class
so, option(d) is true
3. Here, Programmer class overloading the setEmployeeDept method
Overloading : same signature with different arguments
so,option (b) is correct
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.