r/javaexamples • • Jul 24 '26

How to set up Scalar / Swagger

Thumbnail reddit.com
1 Upvotes

r/javaexamples • • Mar 12 '26

Websites with lots of Java nested loops practice problems?

Thumbnail reddit.com
1 Upvotes

r/javaexamples • • Mar 09 '26

Don't guess, measure.

Thumbnail
reddit.com
1 Upvotes

r/javaexamples • • Feb 28 '26

Partitiol List (from stackoverflow)

1 Upvotes

How to partition a list quick and easy

Partition List

Original on stackowerflow, tks BrownRecluse


r/javaexamples • • Feb 27 '26

Java lazy holder non-static

1 Upvotes

Hi

A simple, thread-safe, direct way to lazy initalization.

Nothing more

ExampleOfLazyHolder.java


r/javaexamples • • Feb 27 '26

Groovy web server with redis and mysql under 60 lines of code

1 Upvotes

Hi

It's a proof of concept, but it works, with Java 11+ and Groovy 5.0.2

It retrieves values from a GET request.

First it looks into a redis server used as a cache.

  • First it looks into a redis server used as a cache.

  • If the data is there, it returns to the client

  • If not, it access to MySQL to look for the data

    • If the data is there, it is stored into redis and returned to the client

    • If not, nothing is returned

Only 60 lines of code, so nothing snappy, but it works

It uses Javalin, Jedis and MySQL driver

MyLittleServerRedisMySQLinGroovy.groovy


r/javaexamples • • Nov 12 '25

Foxglove, an alternative for preparing RDB data for unit tests

1 Upvotes

Hey guys, I made a library(Foxglove) for generating data on RDB for unit tests.

As an alternative of @Sql, Foxglove would try to generate data of columns automatically.

If you got some tedious or error-prone feeling when authoring INSERT INTO .. for unit tests on RDB, please check out this library.

Example:

import javax.sql.DataSource;

import guru.mikelue.foxglove.jdbc.JdbcTableFacet;
import guru.mikelue.foxglove.jdbc.JdbcDataGenerator;

// Generates 4 rows with "cr_brand "fixed to "Toyota" and
// 4 different values on "cr_model"
var facet = JdbcTableFacet.builder(TABLE_CAR)
    .numberOfRows(4)
    .column("cr_brand")
        .fixed("Toyota")
    .column("cr_model")
        .roundRobin("Corolla", "Camry", "RAV4", "Prius")
    .build();

new JdbcDataGenerator(getDataSource())
    .generate(facet);

r/javaexamples • • Dec 04 '24

Who has the idea on how to write data persistence and storage for Java

1 Upvotes

r/javaexamples • • Sep 06 '24

Deploy Secure Spring Boot Microservices on Azure AKS Using Terraform and Kubernetes

1 Upvotes

Deploy a cloud-native Java Spring Boot microservice stack secured with Auth0 on Azure AKS using Terraform and Kubernetes.

Read more…


r/javaexamples • • Sep 02 '24

Sorting in Java using Comparator and thenComparing() method

1 Upvotes

I wrote an article about sorting using Comparator and thenComparing() method https://javarevisited.blogspot.com/2021/09/comparator-comparing-thenComparing-example-java-.html


r/javaexamples • • Aug 17 '24

Showcase Weblog Analyser Java Desktop Application

1 Upvotes

A whilst stop tour of Weblog Analyser built using Java with JavaFX as a desktop application.

https://youtu.be/-98ZEiDRo6w


r/javaexamples • • Apr 12 '24

Add Security and Authorization to a Java Spring Boot API

1 Upvotes

Learn how to use Spring Boot, Java, and Auth0 to secure a feature-complete API by implementing authorization in Spring Boot with Auth0.
Read more…


r/javaexamples • • Jan 04 '24

No body in method in class files

1 Upvotes

Hi, While traversing through code, I came across one class where the constructor and method bodies have this , /* Compiled code*/ in intellij idea. This is not the case with other team members system. I tried to cross verify the settings in the intellij but couldn't get anything which could solve my issue. Project is Spring MVC project. Using Jdk1.8 . Intelliij is Ultimate 2023 latest version.


r/javaexamples • • Dec 13 '23

Identity in Spring Boot with Kubernetes, Keycloak, and Auth0

1 Upvotes

A walk-through of building a microservices architecture with JHipster, Keycloak, Auth0, and Google Kubernetes Engine (GKE) deployment.
Read more…


r/javaexamples • • Nov 24 '23

Troubleshooting StackOverflowException in Java Recursion: Tips and Tricks

1 Upvotes

What should you do when your recursive algorithm reaches the recursion limit in a specified JVM target, resulting in a StackOverflowException?🤔
Join us in the latest episode of 'Java Puzzle of the Week' 🧩 as we delve into four possible solutions to tackle this issue.
https://youtu.be/muwv8l4-aWg?si=Jy1JPj7chitvyUKe


r/javaexamples • • Nov 11 '23

Abstract factory design pattern in java

1 Upvotes

Abstract factory design pattern in java complete step by step tutorial

https://youtu.be/u3LuF3t6rp0


r/javaexamples • • Nov 03 '23

Double arithmetic

1 Upvotes

Explore the intricacies of Java doubles in the latest episode of 'Java Puzzle of the Week.' 🧩🔍 We delve into their internals and discuss why they might not be the best choice for financial operations. Don't miss this intriguing exploration!

https://youtu.be/TOhMzfnVO0E?si=832dLcO1BCa70B0_


r/javaexamples • • Oct 31 '23

How to Build a GraphQL API with Spring Boot

1 Upvotes

A step-by-step guide for building a secured GraphQL API with Spring Boot and Auth0 authentication in React
Read more…


r/javaexamples • • Oct 31 '23

How to Build a GraphQL API with Spring Boot

1 Upvotes

A step-by-step guide for building a secured GraphQL API with Spring Boot and Auth0 authentication in React
Read more…


r/javaexamples • • Oct 26 '23

String uppercase

1 Upvotes

Did you know that string transformations like toUpperCase and toLowerCase can work differently for different locales and may even affect the length of a given string? Discover more insights in the latest episode of "Java Puzzle of the Week."

https://youtu.be/2483FxiAQvw?si=HjYH3WIMmE1Sx34l


r/javaexamples • • Oct 18 '23

Numeric overflow in Java

1 Upvotes

Numeric overflow occurs when the value of a numeric type exceeds its defined range, often leading to unexpected and potentially problematic outcomes. For a clear and concise explanation, I prepared a short YouTube video on this topic.

https://youtu.be/5vfTm-rJLds?si=hZ1La6s3VyglDJNq


r/javaexamples • • Oct 05 '23

Java heap pollution

1 Upvotes

Have you heard about Java heap pollution? 🚀 It's an intriguing issue in the world of Java programming. If you're curious to learn more, check out the latest episode of 'Java Puzzle of the Week' 🧩 where we explore this topic. Your thoughts and insights are welcome!
https://www.youtube.com/watch?v=-PXkz8MzCp0


r/javaexamples • • Sep 20 '23

dsa preparation problesm

1 Upvotes

so to practice dsa , which platform is best ?

im beginner 2nd yr in my btech, so

leetcode or codechef or gfg or ??


r/javaexamples • • Sep 07 '23

A simple Java integer comparison - Programming Puzzle of the Week

1 Upvotes

Hello, I've started contributing to a new YouTube series called "Java Puzzle of the Week." 🧩
In this series, I'll delve into short Java code snippets with varying levels of difficulty. 🤓
The first episode tackles integer comparisons. New episodes will appear at every Thursday.

If you're interested, I'd love for you to check it out!

https://www.youtube.com/watch?v=TmuoAo7CkM4


r/javaexamples • • Jun 27 '23

Get started with Spring Boot and Auth0

1 Upvotes

Learn how to add Auth0 to your Spring Boot application using the Okta Spring Boot Starter.
Read more…