• 21 September

    Convert 0 and 1 to boolean in Java

    In this post, we will see how to convert 0 and 1 to Boolean in Java. Given “0” and “1” in String datatype, convert it to boolean datatype where “0” represents false “1” represents true Convert 0 and 1 to Boolean in Java Here is program to convert 0 and 1 to boolean in Java […]

  • 20 September

    Replace Backslash with Forward Slash in Java

    1. Introduction In this post, we will learn about how to replace backslash with forward slash in java. backslash() is used as escape character in Java. For example: It can be used to: Used in special characters such as new line character \n, tab \t Write unicode characters like \u%04x. That’s the reason we can’t […]

  • 20 September

    Remove Backslash from String in Java

    Learn about how to remove backslash from String in Java. backslash() is used as escape character in Java. For example it can be used to: Create special characters such as new line character \n, tab \t Write unicode characters like \u%04x. Ways to Remove Backslash from String in Java 1. Using replace() Method Use String’s […]

  • 20 September

    Convert 0 to 1 and 1 to 0 in Java

    In this post, we wil see how to convert 0 to 1 and 1 to 0 in java. There are lots of ways to convert 0 to 1 and 1 to 0 in Java. Let’s go through them. Using Subtraction This is one of easiest solution to swap 0 to 1 and vice versa. Just […]

  • 20 September

    Get Unix Timestamp in Java

    In this post, we will get unix timestamp in Java. As per wikipedia Unix time is a system for describing a point in time. It is the number of seconds that have elapsed since the Unix epoch, excluding leap seconds. The Unix epoch is 00:00:00 UTC on 1 January 1970. Unix time is standard way […]

  • 20 September

    Return ArrayList in Java

    This article discusses cases of returning an ArrayList in Java from a method. An ArrayList in Java is a collection of elements of the same data type under a single variable name. In different cases, you can return an ArrayList from a method in Java. These cases are as given below. Returning ArrayList from a […]

  • 19 September

    Convert Month Name to Number in Java

    In this post, we will see how to convert Month name to number in Java. Please note that we will use first three letter of month name (First letter as capital) to convert it to Number. There are multiple ways to convert month name to number in java. Let’s go through. Using DateTimeFormatter and TemporalAccessor […]

  • 19 September

    How to Print 2D Array in Java

    Introduction In this article, we get a look on How to print a 2D or Two Dimensional array in java. Arrays are one of the most useful data structures when it comes to data storage. Arrays provide random access to the elements via their index basing which makes both accessing and storing the most efficient. […]

  • 19 September

    Count Number of Decimal Places in Java

    In this post, we will see how to count number of decimal places in java. A Double can not have exact representation, you need to convert it to String to count number of decimal places in Java. There are multiple ways to count number of decimal places in java. Let’s go through them. Using String’s […]