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 are loops in java? What are three types of loops?

0 Answers  


Explain the difference between abstraction and encapsulation.

0 Answers  


What is the purpose class.forname method?

0 Answers  


please write java program of instanceOf keyword implementation

2 Answers   TCS,


What is an infinite loop in java? Explain with an example.

0 Answers  


Is set thread safe java?

0 Answers  


Which is better singleton or static class?

0 Answers  


What is JFC?

0 Answers  


What is polymorphism java example?

0 Answers  


What is the difference between break and continue statements?

0 Answers  


java program with complete 4 oops concepts implemented example

0 Answers   Infosys, NIIT,


What do you understand by casting in java language?

0 Answers  


Categories