Java Reference
In-Depth Information
Results of the Tutorials
Here are the results:
1.
A new project called Tutorials.
2.
In Tutorials, a new package called c3.
3.
In c3, three new classes called EmployeeApp, Employee, and EmpFrame and a class
diagram called c3diagram.
Review Questions
1.
What does a frame's constructor method do?
2.
What is a property?
3.
Given the following label definitions and placements (and assuming all the code is correct
for defining and displaying a frame with these labels):
Label lbl1 = new Label
("Col. Mustard in the library with the wrench");
Label lbl2 = new Label
("Mrs. White in the lounge with the knife");
Label lbl3 = new Label
("Prof. Plum in the kitchen with the gun");
public ClueFrame() {
lbl1.setBounds(10, 150, 75, 20);
lbl2.setBounds(10, 150, 150, 20);
lbl3.setBounds(10, 150, 250, 20);
this .add(lbl2);
this .add(lbl1);
this .add(lbl3);
which of the following is the correct result, and why?
A. Col. Mustard in the lounge with the gun
B. Prof. Plum in the kitchen with the gun
C. Mrs. White in the library with the knife
D. Mrs. White in the lounge with the gun
E. Prof. Plum in the kitchen with the gun
4.
Given the above label definitions and placements (and assuming all the code is correct for
defining and displaying a frame with these labels) and with the following add statements
replacing those above, which of the answers above is the correct result, and why?
this .add(lbl1);
this .add(lbl2);
this .add(lbl3);
 
Search WWH ::




Custom Search