Home » Java » Core Java

Core Java

Retry In The Future

Writing asynchronous code in Javascript is relatively easy. // async function let attempt = 1; while (true) { try { const result = await operationThatMayFail(); // it didn't fail return result; } catch (error) { if (attempt >= maxAttempts || error !== 'Retryable') { // either unhandleable, or no further attempts throw error; } } attempt++; await sleep(pauseTime); } This ...

Read More »

Unit testing private methods

Introduction In this article, I will contemplate the testing of private methods in unit tests. After that, I will propose a way or pattern to do it, if you must. Finally, I will show how you can generate this pattern automatically. And yes, I will also write a takeaway section to know what you have read. Test or not to ...

Read More »

Introduction into GraalVM (Community Edition): Cloud as a Changing Force

1. Introduction The shift towards cloud computing has had a massive impact on every single aspect of the software development process. In particular, the tools and frameworks the developers have had mastered for years suddenly became unfit, or to say it mildly, outdated. To reflect the reality, the whole new family of frameworks and libraries has emerged, collectively called cloud-native. ...

Read More »

Everyone Could Use a Buddy

This is not about Buddy Holly, and while it’s going to cover Big O notation, it’s not about The Big O himself: Roy Orbison. I’d like to share a problem and solution with you. Consider these data structures in Java (other languages are also available): public class Element { private String name; private ElementData someData; private ... // other stuff ...

Read More »

Java Fibonacci Series Recursive Optimized using Dynamic Programming

A quick guide to write a java program print Fibonacci series and find the nth Fibonacci number using recursive optimized using dynamic programming. 1. Overview In this article, we will learn how to print the fibonacci series and find the nth fibonacci number using recursive approach. Printing the Fibonacci series be done using the iterative approach using while and for ...

Read More »

Java TreeMap Vs HashMap With Examples

A quick guide to understand the differences between the TreeMap and HashMap with examples. 1. Overview In this tutorial, We will learn the core differences between TreeMap and HashMap classes with example programs. If you are new to java programming, suggest to go through the below topics. HashMap Examples TreeMap Examples In java, All Map implementations are to store the ...

Read More »

Code a Java Game with (almost) Zero Coding Skills

Today, the gaming industry is getting better day by day with the latest tools and technology. Video games are not only popular among children, and even elders play video games with great enthusiasm. If you are not that into games before, you must look at the graphics and animations included in today’s gaming. Gaming is an industry where there is ...

Read More »