How are observer and observable used in java programming?



How are observer and observable used in java programming?..

Answer / Budh Prakash Singh

The Observer pattern is a design pattern in Java where an object (Observer) is notified when another object (Observable) changes its state. The Observable maintains a list of Observers, and when it changes, it notifies all the registered Observers.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

Is java programming easy?

1 Answers  


What is consumer in java?

1 Answers  


What is string builder?

1 Answers  


What are different access specifiers in java?

1 Answers  


What do you mean by checked exceptions?

1 Answers  


What is difference between path and classpath in java?

1 Answers  


What is an array in java?

1 Answers  


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.

1 Answers  


what Data encapsulation in java?

5 Answers  


What is difference between char array and string?

1 Answers  


What are the rules for variable declaration?

1 Answers  


How do you delete a list in java?

1 Answers  


Categories