About HowToDoInJava and Lokesh Gupta

Lokesh Gupta

Java developer, founder of HowToDoInJava

I started HowToDoInJava in October 2012 to write down what I learned at work, and the site now has more than 1,600 tutorials on Java, Spring Boot, Hibernate, testing and TypeScript. I have worked on Java and Spring applications for more than 20 years, in roles at Hewitt Associates, Hughes Systique, Adobe and Bank of America.

Every tutorial here is written for a developer with a few years of experience who needs a clear answer and working code. The examples are run on the latest stable versions before they go live, and the full source code is in my GitHub repositories.

Away from the keyboard I play table tennis, badminton and carrom, and I watch a lot of films.

What HowToDoInJava Covers

The tutorials cover the Java stack that most teams use at work. The main areas are core Java (the language, collections, streams, concurrency, date and time, I/O), Spring Boot and the Spring projects (Spring Framework, Security, Data, Batch, Cloud, Spring AI), Hibernate and JPA, testing with JUnit and Mockito, build tools (Maven, Gradle), Apache Kafka, and TypeScript.

How the Tutorials Are Written

Each post starts with the answer, because most readers arrive from a search with a specific problem. The concept comes next, and then a complete, runnable example with real output. I check facts against the official documentation (JEPs, Javadoc, Spring reference docs, release notes), not against other blogs.

Versions matter in Java, so each example states the version it was built with, such as Java 25, Spring Boot 4.1 or JUnit 6. When a library changes, the post and its code are updated, and the last updated date on the page changes only when the content does.

Corrections and Contact

If you find an error, a snippet that no longer compiles, or a better way to do something, leave a comment on the post or reach me on LinkedIn, X or GitHub. Corrections are made in the post itself, and the source code repositories accept pull requests.

For advertising or sponsorship questions, see the advertise page. Sponsored content is marked as such and is never mixed into the tutorials.

Leave a Comment

  1. Hi Lokesh
    I am a Java developer from China. I really like your tutorial. I want to translate it into Chinese and put it on github. I hope to get your permission.

  2. Hi Lokesh

    Really appreciate with your bold articles, i love almost all.
    I am just practicing my self for microsevice example. so you have consolidate example, with gateway+ragistry+auth(Oauth 2)+Any service.

    If you had please share code with me
    If possible can you please share your whats app contact number.

  3. Hello Sir,
    Really loved your blogs.
    Please share some good practical reading materials or your blog if any for Apache Kafka with Java and Docker complete example.

    Regards,
    Salman Khan

  4. HI Lokesh, you explain this concurrency topics in a great way, but I cannot find synchronized volatile explained by you.

  5. Hi Lokesh,
    for some reason your singleton page captcha is not working well, so I post my comment here.
    In your Lazy initialization part, you named the double checked version implenetation as EagerSingleton.

    public class EagerSingleton {
        private static volatile EagerSingleton instance = null;
     
        // private constructor
        private EagerSingleton() {
        }
     
        public static EagerSingleton getInstance() {
            if (instance == null) {
                synchronized (EagerSingleton.class) {
                    // Double check
                    if (instance == null) {
                        instance = new EagerSingleton();
                    }
                }
            }
            return instance;
        }
    }
    

    Since its not an Eager initialization i would recommand changing the class name. Apart from that I like very much your blog.

  6. hi lokesh..I want to uninstall oracle10gxe.while deleting msvcr71.dll and oci.dll it is showing an error msg that “the action can’t be completed because it is open in windows explorer”.please suggest me how i will delete msvcr71.dll and oci.dll??

  7. Hi Lokesh, I am trying to display ebills information when a click on view or pay bill. I am trying to do this using spring mvc hibernate jsp. Regarding this i need to send a detailed mail to your mail id inorder to fix some issues.

  8. hi

    do you have any working examples of spring security using
    KeyBasedPersistenceTokenService?

    My requirement is to use json/rest architecture with Spring MVC 3 annotations, spring security with token exchange.

    thanks

    • yeah,I also want a same example where spring security has been implemented with OAuth protocol.OAuth 2.0 is been used by all sites(FB,G+,ebay) to grant permission 3rd party users to use their data.

      I’m sure Lokesh will help on this.It would be helpful for him also.

  9. can u explain these problem clearly

    2) If the class contains members of any class type then only the object references to those members are copied and hence the member references in both the original object as well as the cloned object refer to the same object.

Comments are closed.

About Us

HowToDoInJava provides tutorials and how-to guides on Java and related technologies.

It also shares the best practices, algorithms & solutions and frequently asked interview questions.