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 are loops in java? What are three types of loops?
Explain the difference between abstraction and encapsulation.
What is the purpose class.forname method?
please write java program of instanceOf keyword implementation
What is an infinite loop in java? Explain with an example.
Is set thread safe java?
Which is better singleton or static class?
What is JFC?
What is polymorphism java example?
What is the difference between break and continue statements?
java program with complete 4 oops concepts implemented example
What do you understand by casting in java language?