Java Dailly Tip: Get time period ( hour / half-hour / quarter hour ) of day
Is there any way to download every hour and another period of the day? I mean exactly the result in the form of a list.
Is there any way to download every hour and another period of the day? I mean exactly the result in the form of a list.
I got a recruitment request for two tables. Here it is. Assuming I have two arrays in Java.
I am writing some code to create a txt file and after completely writing in that txt file, completely close the txt file and then zip that file. But, I don't why, it does not wait until file close before file close it zip it..
What's the fastest and best way to check if two lists contain the same items? I mean the standard Java library. The order of the elements should not matter, nor their type.
I wrote an application in spring. The application has three profiles to run, so I have three files.
I have a domain class with unitPrice set as BigDecimal data type. Now I am trying to create a method to compare price but it seems like I can't have comparison operators in BigDecimal data type. Do I have to change data type or is there other way around?
A small frog wants to get to the other side of a river. The frog is initially located on one bank of the river (position 0) and wants to get to the opposite bank (position X+1). Leaves fall from a tree onto the surface of the river.
I am getting the NoClassDefFoundError error when starting a Java application. What is the usual reason for this?
In a given array, find the subset of maximal sum in which the distance between consecutive elements is at most 6.
Hello. During one of the recruitments, I was asked what are the differences between HashMap and HashTable in Java? Which solution is more efficient if we have an application without threads?
I'm just after the interview. I was supposed to show a memory leak in Java but I couldn't create it. How to do it?
I have a word list and a vowel list. How can I select from the list only words that contain the selected vowels? I would like some solutions.
I'm a little confused about the meaning of the Maven snapshot and why are we building it?
I assume that I have a list of objects and I need to sort it by the given field. I quickly wrote a class that implements Comparator and it works. But looking at my code, I have doubts as to whether I should use the Comparable interface instead of creating a completely new class that implements Comparator.
I'm implementing the List interface for a clone of ArrayList. I'm trying to implement sort. java.util.List sort method I'm not sure how to implement the case where the comparator is null. My ArrayList does not extend Comparable because I want to be able to store non-comparable objects in the list.
If you have a java.io.InputStream object, how should you process that object and produce a String? Suppose I have an InputStream that contains text data, and I want to convert it to a String, so for example I can write that to a log file.
Everyone has written software and thought if there was a better way to write this piece. Fortunately, Java is such a popular language that there are many ways to write the same code. In addition, there are several libraries or frameworks that significantly improve your code work. In this article, I have covered a few of them.
Strings are immutable. This means that after creating a String, if another process can dump memory, there is no way (other than reflection) to get rid of the data before garbage collection begins.
I use InputStream to read some data, so I want to read characters until new line or '\n'.
Meet my next guest. He name is Gil Zilberfeld. For over 20 years, He had developed, tested, managed and designed software products. He had gone through failures and successes, in different types of projects and companies.
Suppose we have a HashMap object with 100 records and we want to improve search performance.
I use Java Maps a lot, but can't iterate well over them. How to do it efficiently? There are several ways to work with Maps in Java. Here are the most popular of them.
This quick post explains why some operators need to be cast while others do not, and why.
Searching for a range within a given range does not seem difficult, yet we got the question of how to do it quickly and efficiently. Java allows you to do this in many ways. We've covered a few below.
Parameters and local variables are allocated on the stack (for reference types, the object is on the heap and a variable on the stack refers to this object on the heap). The stack is usually located at the top of your address space and when it is used up, it moves to the bottom of the address space (i.e. towards zero).
I managed to collect 10 tips that we often forget about. Each of them is extremely important both during the first job in IT and at later stages of the career. Of course, you can agree with me or not, that's your business. Are we starting?
Hugh McKee is a developer advocate at Lightbend. He has had a long career building applications that evolved slowly, that inefficiently utilized their infrastructure, and were brittle and prone to failure. That all changed when he started building reactive, asynchronous, actor-based systems. This radically new way of building applications rocked his world. As an added benefit, building application systems became way more fun than it had ever been. Now he is focused on helping others to discover the significant advantages and joys of building responsive, resilient, elastic, message-driven applications.
We managed to publish the fourth issue of the newsletter. That's as many as 44 a4 pages devoted to the Java language.
Many juniors write their first Java project and then have that project reviewed by other developers. Sometimes such projects collect a large amount of criticism. And that's another thing no programming bootcamp can teach you. There are 12 main rules in Java to make your code clearer and more understandable.
Programming is simple and it is for everyone. No studies and no skills are needed. This is how they sell us the essence of programming various types of bootcamps and other training ...