Skip to content

Tag: java-17

Why does jshell show this number?

I am learning java and this logic makes me feel confused. Isn’t here i=20(+1)+20(+1)? Why 41 instead of 42? See this code run at Ideone.com. Answer Effectively, the expression i=i++ + i++; is equal to i=i++ + i;. Why? The latter i++ result value is never used and is not propagated. The result of the pos…

Unsupported class file major version 61

I am trying to integrate Glowroot into my Java application. Unfortunately, I get the following error: Neither Glowroot nor my application seem to use gradle so I have no idea where this incompatibility is coming from. Have you got any idea on how I could find the source of the incompatibility and then how I c…

void with Generics in Java

I have a function that returns void Generic method Implementation of generic interface How can I use void in IRequestHandler<DeleteProductCommand, Void> so that I can map void from iProductService.delete(deleteProductCommand.id); Answer Option 1: Just return null: Option 2: Update the IProductService::d…