Skip to content

Tag: java

Webclient sending request body with get request

I have a spring-boot project called carrental-crud with an h2 memory database, and I want to access one of the endpoints from another project called carrental-api. I use webClientBuilder for this on my other endpoints, but it is throwing status 500 with bad request when I try using it in postman. I use JPArep…

How to get a generic type which is defined on method in Java?

Question 1: Suggest I have a example like this: then can I get type String in methodA without actually passing String to it? Question 2: If the previous example is transformed to this: I mean what was passed into methodA is no more a simple object but a lambda expression, also, can I get type String in method…

where to store data read from file [closed]

Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 1 year ago. Improve this question I am making a semester project for my University OOP course. I am maki…

Java method should cache the results

I’m learning programming in the language java. I need to write an application that takes a string and returns the number of unique characters in the string. It is expected that a string with the same character sequence may be passed several times to the method. Since the counting operation can be time-c…