Avatar of Zolf
Zolf
Flag for United Arab Emirates

asked on 

Java Lambda expression help

Hello there,

I am going through a tutorial on Vert.x and came across this lambda code which I want to replace it with ordinary code i.e. without using lambda expression. Can somebody please help me to replace this lambda expression so i know what is going on

public class MyFirstVerticle extends AbstractVerticle
{
	@Override
	public void start(Future<Void> fut)
	{
		vertx.createHttpServer().requestHandler(r -> {
			r.response().end("<h1>Hello from my first " + "Vert.x 3 application</h1>");
		}).listen(8080, result -> {
			if (result.succeeded())
			{
				fut.complete();
			} else
			{
				fut.fail(result.cause());
			}
		});
	}
}

Open in new window

JavaJava EE

Avatar of undefined
Last Comment
mccarl

8/22/2022 - Mon