Looking for something else? Check the categories of Java:
Class loading Garbage Collection Google Guava Hibernate Java Java 8 Java bytecode Java collections Java concurrency Java I/O Java Instrumentation Java memory model JPA JUnit Maven Monitoring Off-heap Play Framework Spring Data JPA Spring framework Spring Integration Spring security Spring Web MVC Tomcat
If not, below you can find all articles belonging to Java.
Sometimes we need to cache only singular object, without associating it with any key. In this case the use of Guava's LoadingCache is not well adapted. But fortunately, Guava provides another objects to deal with this situation - Suppliers.
In one of previous articles we discovered the idea of Java agents. We mentioned that instrumentation package can be used to develop them. It's the time to approach this topic deeper.
Java introduces more and more event-driven features. One of them is WatchService which allows to handle files-related events.
Generational garbage collection is one of strategies used to automatically remove useless objects from memory. JVM has 2 categories of generations: young and old.
Very often the first version of given language influences programming knowledge. When somebody started with Java 6 and has never used Java agent, this feature introduced in Java 5 can appear mysterious.
Writing a good code includes writing a code well documented. Usually, "well documented" helps programmer to avoid going to see 10 other people before understanding what the code really does.
Often consumer-producer applications stores common elements in shared queue. Java offers different types of this data structure and one of them is TransferQueue.
With Java 8 comes a complementary class to classical Future objects. This class not only helps to work with promises but also makes possible to get future results in non-blocking way.
So far only Google Guava allowed us to easily process collections. But the arrival of Java 8 brought a serious alternative to this library - streams.
Atomicity in thread-safe parallel programming is one of crucial points. Thanks to it, any thread participating in the parallel code execution receives the final value, without the risk to get an "intermediate" value modified by another thread.
Java 9 comes quietly to Java ecosystem and Spring Framework already successfully tested the build on early release on the new Java version. If we add to this the backward compatibility between Java 8, 7 and 6, we could ask us the question: How does it succeed that ?
When performance matters (when it does not?), dealing with a big task can prove to be very costly. One of solutions for this kind of bottlenecks could be the using of divide and conquer algorithms. In Java it can be retrieved in fork/join framework.
Working with collections in multi-threading environment is a little bit tricky. But fortunately, Java offers some objects able to store data in thread-safe way. One of them is CopyOnWriteArrayList, introduced with Java 5.
Java 8 brings another type of ForkJoinTask, CountedCompleter. And because sometimes this class is considered little bit obscure, we'll try to understand it through this article.
Arrays and collections look similar. Both handle a group of similar type of objects. However, they have some differences, going from the simplest maintainability cases going to performance ones.
Java 7 was released in 2011 and brought to us, programmers, several interesting features as diamond operators or new I/O library. Yet another useful thing is less popular than two cited previously - Objects tool class.
Enumerations storage in Java can be achieved through classical collections, such as lists or queues. However, one specific class is adapted to manage only enums - EnumSet.
Nowadays more and more applications are composed by several different data layers, beginning from the classical RDBMS and finishing in more adapted to some situations (search or graph relationships for example) NoSQL solutions. An interesting feature of JPA allows to notify no-JPA layer about some changes made on entities, exactly as in other solutions coming from event-driven development approach.
Until now in our examples we were using object inheritance based on entity classes (@Entity). However, we can also construct classes hierarchy without that, by using another JPA's annotation: @MappedSuperclass.
One of reasons-to-be of relational databases are relations. JPA provides very flexible way of manipulating them, through cascade attribute of annotations responsible for related objects (database tables).