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.
What is the use of default method in interface in java? Explain
How dead lock situation occurs in java and how you can identify it?
What is a line separator in java?
What is anti pattern in cyber security?
Can Anybody tell the diff b/w jdk1.6 and latest version.
Why parsing is done?
Difference between the String and StringBuffer classes?
Does java list allow null?
What is the purpose of tostring() method in java?
What is the difference between preemptive scheduling and time slicing?
Which is easier .net or java?
How do I know if java is installed?