According to the below, if you don't set an executor, requests are handled serially, i.e. one by one. That would make for a very slow web server.
executor
: Allows you to configure the Executor
which will be used to handle HTTP requests. By default com.sun.net.httpserver.HttpServer
uses a single thread (a calling thread executor to be precise) executor to handle traffic which might be fine for local toy projects.