Home » Java » Page 4

Java

It Broke vs You’re Wrong

java-interview-questions-answers

When building REST APIs for microservices, there are a few design decisions to make about responses. Some responses are clearly a product of the protocols surrounding your microservice – things like the 3xx codes for instance are all about redirects and routing. In general, you will be trying to get the right 2xx codes for success. If in doubt, it’ll ...

Read More »

Proving There’s No Exception

How do you prove the existence of nothingness? Should you? In some tests I’ve written, especially around either validation, or around creating an empty object, what I really want to write is something like: 1 2 assertThat( ... call some code ... )    .doesntThrow(); You could reasonably write something like this. It would be the obverse of the assertThatThisThrowsException type ...

Read More »

Discovering the Magic Version Number of .class Files

Abstract What version of Java was used to create your .class files? For your own projects, this is easy to figure out because you choose your Java version when you compile. For the hundreds or thousands of dependencies in your project, this question is not so easy to answer. Inside every .class file is a magic number with a byte ...

Read More »

RESTful services with HATEOAS. REST: The Refresher

java-interview-questions-answers

In this post, we feature a comprehensive article about RESTful services with HATEOAS. REST: The Refresher. 1. Introduction “Oh no! Please, not another article about REST!” many of you may scream, and rightly so. There are so many tutorials, posts, discussions and best practices published already, than it hardly makes any sense to come up with one more. Frankly speaking, ...

Read More »

Getting started with Quarkus

Quarkus – A Kubernetes Native Java stack tailored for OpenJDK HotSpot and GraalVM, crafted from the best of breed Java libraries and standards. – is a container-first framework optimized for fast boot times and low memory consumption. The framework is build on top of many popular Java libraries and it provides support for building standard REST as well as reactive ...

Read More »