The State of a system is the stored information that determines its current status at a certain point in time.
Stateless system
Does not store information about past interactions with the system. So, it’s like the first interaction each time.
Code Block | ||
---|---|---|
| ||
class Return{
String interact(String input) {
return input;
}
} |
Other example of stateless system : HTTP (application layer protocol in the TCP/IP model used to transfer information between devices in a network); IP or Internet Protocol (network layer in the TCP/IP model used for sending packets from source to destination).
Statefull system