• 29 February

    Java long to String

    In this post, we will see how to convert long to String in java. There are lot of ways to convert long to String.Let’s see each one by one. Using Long.toString() You can use Long class toString() method to convert long to String. [crayon-6095491c4d439836203285/] In case, Long can be null and you don’t want to […]

  • 06 October

    Java remove last character from string

    Learn about how to remove last character from String in java using different ways.

  • 06 October

    Java isNumeric method

    In this post, we will see how to implement isNumeric method in java. There are many way to check if String is numeric or not. Let’s see one by one. Using regular expressions You can use below regular expression to check if string is numeric or not. [-+]?\\d*\\.?\\d+ [crayon-6095491c4e2e7040117587/] Output: 223 is numeric : true […]

  • 06 October

    Convert char to lowercase java

    You can use Character class’s toLowerCase method to convert char to lowercase in java. Method signature [crayon-6095491c4e9f6187754606/] Parameters ch is primitive character type. Return type return type is char. If char is already lowercase then it will return same. [crayon-6095491c4e9fc938665647/] When you run above program, you will get below output: a y b z That’s […]

  • 06 October

    Convert char to uppercase java

    You can use Charater class’s touppercase method to convert char to uppercase in java. Method signature [crayon-6095491c4eec2282725794/] Parameters ch is primitive character type. Return type return type is char. If char is already uppercase then it will return same. [crayon-6095491c4eec7593629144/] When you run above program, you will get below output: A Y F U That’s […]

  • 06 October

    Java isLetter method

    Character class’s isletter method can be used to check if character is letter or not. Method signature [crayon-6095491c4f263648465745/] Parameters ch is primitive character type. Return type boolean is primitive character type. [crayon-6095491c4f269043987785/] When you run above program, you will get below output: true true false false That’s all about java Character’s isletter method.

  • 21 October

    Difference between equals() and == in java

    In this post, we will see about the difference between equals and == in java. This is most asked java interview question for fresher or 2-year experienced java developer and it might be confusing sometimes. Let’s try to understand each quickly. Equality operator “==” Equality operator can be used to compare primitives but when you […]

  • 30 September

    Longest common substring

    If you want to practice data structure and algorithm programs, you can go through 100+ data structure and algorithm programs. In this post, we will see how to find the longest common substring in java. Program Given two String, find longest common substring. For example: String 1: Java2blog String 2: CoreJavaTutorial Longest common subString is: […]

  • 27 September

    Print maximum occurring character in a String

    In this post, we will see how to print the maximum occurring character in a String. Problem Print maximum occurring character in a String For example: String 1: java2blog tutorial Character: a has occurred maximum times in String: 3 ———————- String 2: This is test message Character: s has occurred maximum times in String: 5 […]