Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

can you write this in scala? public class ObserverMain { public static void main ( String [ ] args ) { ConcreteSubject subject 1 =

can you write this in scala? public class ObserverMain {
public static void main(String[] args){
ConcreteSubject subject1= new ConcreteSubject();
ConcreteSubject subject2= new ConcreteSubject();
TerminalLogger logger = new TerminalLogger();
subject1.attach(logger);
subject2.attach(logger);
subject1.setState("State 1");
subject2.setState("State 2");
}
}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

What are some of the possible scenes from our future?

Answered: 1 week ago