I'm not sure what OP meant. But for Java, your app runs inside an application server like Tomcat which handles the low level networking for you, I believe this fulfills a similar role as web servers fill for other languages like PHP.
Basically these severs provide a separation of concerns and are built to be more scale-able than a naive application listening on a port for requests.