Analog = progressive movement in each direction that you push the stick. For example in a flight sim if you want to move the rudder half way you would only push the stick half way.
Digital = each direction that you point the stick in is 100% maximum ON in that direction. Nothing in between
Some joysticks have switches (microswitches or leaf switches) to detect movement.
These type can only be Digital
There also some with optical sensors to detect movement.
Currently the most popular of these are the 49 way sticks
These can be configured to behave as Analog or Digital
Rotary sticks have a spinner built into the handle.
The handle actually spins in addition to regular joystick movement.
This feature only works for games that were designed to use it.
Rotary sticks can be analog or digital and can have either switches or optical sensors to detect movement.