To define the term Stateless and stateful just  check out the give program.
ST
A
T
E
L
E
S
S
//The state is derived by what is passed into the function
function int addOne(int number)
{
return number + 1;
}
Stateful
//The state is maintained by the function
private int _number = 0; //initially zero
function int addOne()
{
_number++;
return _number;
}
Â