Skip to content

Santhosh Ponnam

Technology Blog

  • Home
  • About
  • Technology
    • Java
    • ORM
  • Privacy Policy
  • Toggle search form
  • Another Log4j Bug – DoS Java
  • JPA vs Hibernate – Specification Vs Implementation ORM
  • Windows Commands – kill port number Installations and Configurations
  • HikariCP Connection Pooling for Spring Boot for 1.x version Spring Boot
  • Unique Random ‘N’ digit Number generator Java
  • Why to have a private constructor? Java
  • Setting Environment Variables in Windows Java
  • HikariCP Configurations – Database Connection Pooling Installations and Configurations

hashCode and equals methods in java

Posted on November 2, 2016August 12, 2021 By Santhosh Ponnam

Usage of hashCode() and equals()hashCode() method returns integer for a given object. This integer is used for determining the bucket location, when this object needs to be stored in some HashTable like data structure. By default, Object’s hashCode() method returns an integer representation of memory address where object is stored. equals() method is used to…

Read More “hashCode and equals methods in java” »

Java

Unique Random ‘N’ digit Number generator

Posted on August 12, 2016August 13, 2021 By Santhosh Ponnam
package com.santhosh.random;

import java.util.Random;

import org.apache.commons.lang3.StringUtils;

public class SequenceGenerator {
    private final Random random;

    public SequenceGenerator() {
        random = new Random();
    }

    /**
     * Returns a pseudo-random integer between 0 and n-1.
     *
     * @see Random#nextInt(int)
     */
    public int nextInt(int n) {
        return random.nextInt(n);
    }

    public static void main(String[] args) {
        SequenceGenerator g = new SequenceGenerator();
        String result = StringUtils.leftPad(String.valueOf(g.nextInt(99999)),
                5, '0');
        System.out.println(result);
    }
}
Java

Setting Environment Variables in Windows

Posted on August 2, 2016August 12, 2021 By Santhosh Ponnam

Why do I need to set JAVA_HOME? Many Java based programs like Tomcat require JAVA_HOME to be set as environment variable to work correctly. Please note JAVA_HOME should point to a JDK directory not a JRE one. The point of setting the environment variable is to let programs know in which directory executables like javac can be…

Read More “Setting Environment Variables in Windows” »

Java

Posts navigation

Previous 1 2

Recent Posts

  • Another Log4j Bug – DoS
  • Log4j Vulnerability / Version Upgrade to 2.16.0 by Apache Team
  • Fixing Log4j Vulnerability
  • Log4J (RCE) Vulnerability
  • JPA vs Hibernate – Specification Vs Implementation

Categories

  • Installations and Configurations
  • Java
  • ORM
  • Spring Boot
  • Spring Boot HikariCP Connection Pooling

Archives

  • December 2021
  • August 2021
  • November 2020
  • March 2020
  • August 2018
  • November 2016
  • August 2016

Recent Posts

  • Another Log4j Bug – DoS
  • Log4j Vulnerability / Version Upgrade to 2.16.0 by Apache Team
  • Fixing Log4j Vulnerability
  • Log4J (RCE) Vulnerability
  • JPA vs Hibernate – Specification Vs Implementation

Categories

  • Installations and Configurations
  • Java
  • ORM
  • Spring Boot
  • Spring Boot HikariCP Connection Pooling

Archives

  • December 2021
  • August 2021
  • November 2020
  • March 2020
  • August 2018
  • November 2016
  • August 2016




Recent Posts

  • Another Log4j Bug – DoS
  • Log4j Vulnerability / Version Upgrade to 2.16.0 by Apache Team
  • Fixing Log4j Vulnerability
  • Log4J (RCE) Vulnerability
  • JPA vs Hibernate – Specification Vs Implementation

Categories

  • Installations and Configurations
  • Java
  • ORM
  • Spring Boot
  • Spring Boot HikariCP Connection Pooling
  • Why to have a private constructor? Java
  • Windows Commands – kill port number Installations and Configurations
  • Log4j Vulnerability / Version Upgrade to 2.16.0 by Apache Team Java
  • Unique Random ‘N’ digit Number generator Java
  • HikariCP Configurations – Database Connection Pooling Installations and Configurations
  • Setting Environment Variables in Windows Java
  • Sonar Qube – Code Coverage and Code Quality Tool Installations and Configurations
  • hashCode and equals methods in java Java

Copyright © 2023 Santhosh Ponnam.

Powered by PressBook News WordPress theme