• Print CLASSPATH in java
    08 February

    Print Classpath in Java

    In this post, we will see how to print CLASSPATH in java. 💡 Outline You can use System.getProperty("java.class.path") to get ClassPath in java. [crayon-6273ed9099fba608325136/] What is CLASSPATH in java CLASSPATH variables tell application to location where it should find user classes. Default CLASSPATH is current working directory(.). You can override this value using CLASSPATH variables […]

  • Get unicode value of character in java
    07 February

    Get Unicode Value of Character in Java

    In this post, we will see how to get unicode value of character in java. Get Unicode Value of Character in Java You can simply use below code to get unicode value of character in java. [crayon-6273ed909a606775446471/] Here is complete example to print unicode value of character in java: [crayon-6273ed909a60e868156625/] Output Unicode value of character […]

  • 07 February

    Get number of days in Month in java

    Learn about how to get number of days in Month in java. Get number of days in Month in java Using YearMonth’s lengthOfMonth() [Java 8] You can use YearMonth‘s lengthOfMonth() method to get number of days in Month in java. Pass Year and month to YearMonth’s of and create YearMonth object. Call lengthOfMonth() on YearMonth’s […]

  • Get last day of month in java
    04 February

    Get last day of Month in java

    Learn about how to get last day of month in java. There are times when you need to get last day of month to process data at the end of each month. For example: Processing salaries of the employee in your company. There are multiple ways to get last day of month in java Ways […]

  • Find character in String in java
    02 February

    Find Character in String in Java

    In this post, we will see how to find character in String in java. How to Find Character in String in Java There are multiple ways to find char in String in java 1. Using indexOf() Method to Find Character in String in Java indexOf() method is used to find index of substring present in […]

  • How to print multiple variables in java
    31 January

    How to Print Multiple Variables in Java

    In this post, we will see how to print multiple variables in java. Ways to Print Multiple Variables in Java Here are two primary ways to print multiple variables in java. Using System.out.print You can use System.out.println to print two String variables in java as below: [crayon-6273ed909c228539934764/] Output: Country: India Capital: Delhi As you can […]

  • 02 February

    Remove Comma from String in Java

    Learn about how to remove comma from String in java. Remove comma from String in java 1. Using replace() method You can use String’s replace() method to remove commas from String in java. Here is syntax of replace method: [crayon-6273ed909c4fa295248693/] [crayon-6273ed909c4ff062238658/] Output: India China Bhutan 2. Using replaceAll() method You can also use replaceAll() method […]

  • Java ArrayList of objects
    25 January

    Create ArrayList of Objects in Java

    In this tutorial, we will learn how to create ArrayList of objects in Java. We will create a Book class with different properties and use it to create custom book objects when creating an ArrayList of objects. We will filter these book objects using certain criteria and add the book objects that meet the criteria […]

  • Split String by pipe in java
    15 January

    Split String by pipe(|) in java

    In this post, we will see how to split String by pipe in java. How to split String by pipe in java There are multiple ways to split String by pipe (|) in Java. Using split() method You can use String’s split() method to split String by pipe in java. Let’s say you want to […]