Question: 18. According to the state pattern, each state should Be a read-only constant Implement a common interface Be immutable, and not inheritable None of the

18. According to the state pattern, each state should Be a read-only constant Implement a common interface Be immutable, and not inheritable None of the above 19. Which objects actually change the state of the gumball machine in our state pattern example The qumball machine O The states themselves A client for the gumball machine O An observer that is updated when there are changes to the gumball machine 20. Suppose you have an already existing software system that works with objects of a certain type. Suppose further that your boss asks you to integrate some vendor-supplied code with your current code base, and that the vendor-supplied code has a different interface than the objects your system works with. The best pattern to use would be O Simple factory pattern Observer pattern Adapter pattern Facade pattern 21. Java has interfaces. Do other languages? In the following Python code (it's simple, just read it) class Exa ple: #constructor def init_(self): does nothing pass def do thisiself): print "did this" def do that self) primt "did that The interface for this code is The method signatures of this class class Example O A trick question, Python doesn't have interfaces None of the above
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
