Skip to content
Sharp

Networking · interview question

In Java's HttpClient, which method is used to build the client instance before making requests?

Multiple choiceEasychapter-11-curatedpremiumnetworkinghttpclient-basics
java
HttpClient client = HttpClient.newBuilder().build();
Choose one answer
Answer and explanation

Correct answer

A. Build()

Why

The build() method in the HttpClient.Builder class finalizes the setup of the HttpClient instance. It follows the builder pattern, allowing you to configure various options before calling build().

Test yourself on Networking

A free test with instant, explained results. No account needed.

Start free test
All Networking questions →