So, basically the title. I got 2 microservices. One generates and sends a zip file and the other one receives it, then does some magic, converts it to an array[] of bytes and then sends it somewhere else. But it’s just in theory – I coldn’t make it work. I need to download a Resource (https:…
Tag: java
Spring not calling the default constructor
I have made a simple spring boot application: Here I have put @Component annotation on the Student class. So I can get the student object from the application context. But the id and name are not initialized as per the default constructor. What could be the reason for this? Does spring not call the default co…
Inheritance, setters and getters (Game Class Output)
How am I supposed to decrease its armor first and next the health? I want not to print the negative of armor, and I want to print if the armor gets 0, the health should be the next to decrease. For Instance in Testing Class, I use wizard and cast a spell to fireball 3 times to knight. Since knight
Checking a tree to be a BST
Here is my attempt to check whether a tree is a BST or not: Code works fine as tested with multiple test cases. But I am not sure if this is a good, clean approach. Recursive method is big it seems. I am dealing with scenarios like null left node, null right node, node itself null, both child nodes null
the menu is not displayed in the xml file already tried everything, nothing works
The main problem is that the menu bar is not displayed in my layout file. I’ve done a few searches but haven’t been able to find a solution or a reason as to why it is behaving this way. Any help would be appreciated. Thanks. my menu file XML my layout file Where am I doing wrong? I checked some
My activity_main.xml is not showing my contacts
In my Android Studio layout file for my MainActivity class, there is a layout that used to show my contacts but it doesn’t work anymore. This is how the layout shows: This is what shows in the emulator (note: I already have added contacts). I’m not sure if it has to do with the layout, the MainAct…
How deal with testing in Java for long time?
I want to test this method: And this is the test (yes, longer test than methods 🙂 ): But, I have a small clock shift. For example: So, the time it is the same, only about 798 of difference. Edit 1 For the moment, I solved with: Is there a more elegant method? Answer In general, when you work with
Http request and response from rabbitmq
I have question about http request and rabbit mq . How I can have this sample 1- client request to server with http request 2- severe after receive request put to rabbit mq 3- in one job , lisiner read message after process on time response to client with http response Is it possible ? If yes please help me
Does the classloader load a class file if the corresponding class is never used?
To make my question more clear, consider following use-case: Suppose there is a package that permits a set of operations on a given platform, for example a class to edit the registry on Windows. This package does not exist on other platforms, as there is no equivalent operation on other operating system. For …
Rearrange substrings using two criteria [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 12 months ago. Improve this question Given a String: I need to sort its substrings first by numbers (in desce…