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

What is the use of default method in interface in java? Explain

0 Answers  


How dead lock situation occurs in java and how you can identify it?

0 Answers  


What is a line separator in java?

0 Answers  


What is anti pattern in cyber security?

0 Answers  


Can Anybody tell the diff b/w jdk1.6 and latest version.

2 Answers  


Why parsing is done?

0 Answers  


Difference between the String and StringBuffer classes?

3 Answers  


Does java list allow null?

0 Answers  


What is the purpose of tostring() method in java?

0 Answers  


What is the difference between preemptive scheduling and time slicing?

0 Answers  


Which is easier .net or java?

0 Answers  


How do I know if java is installed?

0 Answers  


Categories