Draw a UML class diagram for the code fragment given below:
public class StringApplet extends Applet {
private Label sampleString;
private Button showTheString;
private ButtonHandler bHandler;
private FlowLayout layout;
public StringApplet() {
sampleString = new Label(" ");
showTheString = new Button (" Show the String");
bHandler = new ButtonHandler();
layout = new FlowLayout();
showTheString.addActionListener(bHandler);
setLayout(layout);
add(sampleString);
add(showTheString);
}
class ButtonHandler implements ActionListener {
public void actionPerformed(ActionEvent e) {
samplestring.setText("Good Morning");
}
}
}
Note: The methods need not be indicated on the diagram.


No Answer is Posted For this Question
Be the First to Post Answer

Post New Answer

More Core Java Interview Questions

who was the founder of java

32 Answers   CTS, HCL, ProKarma,


Explain the access modifiers for a class, method and variables?

0 Answers   Global Logic,


What is boolean in java?

0 Answers  


Difference between Array and vector?

9 Answers  


Iterator in the HashMap is fail-safe means what?

9 Answers   CTS, IBM, Subex,






What is a final class in java?

0 Answers  


Can we have multiple public classes in a java source file?

0 Answers  


Can you override a private or static method in java?

1 Answers  


Explain about core java?

0 Answers  


What is the use of object and class classes?

0 Answers  


Can you give names of Container classes?

0 Answers   Ordain Solutions,


how to make the double-tone class ? as we have singletone class..?

1 Answers   IBM, Microsoft,


Categories