In State pattern a class behaviour changes based on its state. This kind of design pattern comes under behaviour pattern.
In State pattern, we create objects which stand for different states and a context object whose behaviour is different as its state object alteration.
We are going to make a State interface important an action and concrete state classes implementing the State interface. Framework is a class which carries a State.
StatePatternDemo, our presentation class, will use Context and state items to demonstrate modify in Context behaviour based on type of state it is in.
Create an interface.
Create concrete classes implementing the similar interface.
Create Context Class.
Use the framework to see modify in behaviour when State changes.
Verify the output.
Design Patterns Related Interview Questions
|Java Script Interview Questions||AJAX Interview Questions|
|Graphic Design Interview Questions||Adobe Indesign Interview Questions|
|Java-Multithreading Interview Questions||Database Design Interview Questions|
|Compiler Design Interview Questions||CSS Advanced Interview Questions|
|Java Design Patterns Interview Questions||Hardware design Interview Questions|
|Material Design Lite Interview Questions||Object Oriented Analysis and Design Interview Questions|
|Standard Template Library (STL) Interview Questions|
Design Patterns Tutorial
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.