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

Why do you canvas?

0 Answers  


What is complexity in java?

0 Answers  


Why should we use singleton pattern instead of static class?

0 Answers  


what type of questions asked for barclays technologies pune please send urgent

0 Answers  


Can we extend a class with private constructor?

0 Answers  






Explain about java sdk?

0 Answers  


Explain about core java?

0 Answers  


what is the difference between java and j2ee... is that can i work j2ee on net beans IDE 6.0

2 Answers  


When can an object reference be cast to an interface reference in java programming?

0 Answers  


Why singleton class is used in java?

0 Answers  


What is meant by method overriding?

0 Answers  


what is difference between method overloading & method overridding with example?

4 Answers   IBM,


Categories