Exam 10: Interfaces
Exam 1: Introduction98 Questions
Exam 2: Using Objects76 Questions
Exam 3: Implementing Classes103 Questions
Exam 4: Fundamental Data Types125 Questions
Exam 5: Decisions120 Questions
Exam 6: Loops128 Questions
Exam 7: Arrays and Array Lists118 Questions
Exam 8: Designing Classes95 Questions
Exam 9: Inheritance101 Questions
Exam 10: Interfaces85 Questions
Exam 11: Inputoutput and Exception Handling109 Questions
Exam 12: Object-Oriented Design104 Questions
Exam 13: Recursion110 Questions
Exam 14: Sorting and Searching109 Questions
Exam 15: The Java Collections Framework110 Questions
Exam 16: Basic Data Structures104 Questions
Exam 17: Tree Structures110 Questions
Exam 18: Generic Classes75 Questions
Exam 19: Graphical User Interfaces76 Questions
Exam 20: Streams and Binary Inputoutput82 Questions
Exam 21: Multithreading82 Questions
Exam 22: Internet Networking74 Questions
Exam 23: Relational Databases75 Questions
Exam 24: XML74 Questions
Exam 25: Web Applications75 Questions
Select questions type
Consider the following code snippet: public static void main(String[] args)
{
Final Order myOrder = new Order();
JButton button = new JButton("Calculate");
Final JLabel label = new JLabel("Total amount due");
) . .
Class MyListener implements ActionListener
{
Public void actionPerformed(ActionEvent event)
{
) . .
}
}
}
Which of the local variables can be accessed within the actionPerformed method?
(Multiple Choice)
4.9/5
(32)
Consider the following code snippet: public static void main(String[] args)
{
Order myOrder = new Order();
JButton button = new JButton("Calculate");
JLabel label = new JLabel("Total amount due");
) . .
Class MyListener implements ActionListener
{
Public void actionPerformed(ActionEvent event)
{
Label.setText("Total amount due " + myOrder.getAmountDue());
}
}
}
What is wrong with this code?
(Multiple Choice)
4.9/5
(37)
To use an interface, a class header should include which of the following?
(Multiple Choice)
5.0/5
(42)
Consider the following code snippet: public class Demo
{
Public static void main(String[] args)
{
Point[] p = new Point[4];
P[0] = new Colored3DPoint(4, 4, 4, Color.BLACK);
P[1] = new ThreeDimensionalPoint(2, 2, 2);
P[2] = new ColoredPoint(3, 3, Color.RED);
P[3] = new Point(4, 4);
For (int i = 0; i < p.length; i++)
{
String s = p[i].toString();
System.out.println("p[" + i + "] : " + s);
}
Return;
}
}
This code is an example of ____.
(Multiple Choice)
4.7/5
(41)
To build a user interface that contains graphical components, the components ____.
(Multiple Choice)
4.9/5
(37)
Consider the following code snippet: public class Inventory implements Measurable
{
) . .
Public double getMeasure();
{
Return onHandCount;
}
}
Why is it necessary to declare getMeasure as public ?
(Multiple Choice)
4.7/5
(40)
Which of the following statements about interfaces is true?
(Multiple Choice)
4.9/5
(39)
You wish to detect when the mouse is moved into a graphical component. Which methods of the MouseListener interface will provide this information?
(Multiple Choice)
4.7/5
(40)
Which of the following statements about interfaces is NOT true?
(Multiple Choice)
4.9/5
(43)
Consider the following code snippet: public class Inventory implements Measurable
{
) . .
Double getMeasure();
{
Return onHandCount;
}
}
What is wrong with this code?
(Multiple Choice)
4.8/5
(33)
Which of the following statements about an inner class is true?
(Multiple Choice)
4.9/5
(33)
____ occurs when a single class has several methods with the same name but different parameter types.
(Multiple Choice)
4.7/5
(41)
The ____ method should be called whenever you modify the shapes that the paintComponent method draws.
(Multiple Choice)
4.7/5
(37)
Which of the following statements about interfaces is NOT true?
(Multiple Choice)
4.7/5
(33)
To associate an event listener with a JButton component, you must use the ___ method of the JButton class.
(Multiple Choice)
4.9/5
(39)
Consider the following code snippet: myImage.add(new Rectangle(10,10,10,10));
This code is an example of using ____.
(Multiple Choice)
4.9/5
(33)
Showing 61 - 80 of 85
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)