• 30 September

    How to compare characters in Java

    Learn about how to compare characters in java using different methods.

  • 17 March

    New line character in java

    In this post, we will see about new line character in java and how to add new line character to a String in different operating systems. Operating systems have different characters to denote the end of the line. Linux and new mac: In Linux, the end line is denoted by \n, also known as line […]

  • 06 October

    Java remove last character from string

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

  • 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-60469167c6946167395639/] Parameters ch is primitive character type. Return type return type is char. If char is already lowercase then it will return same. [crayon-60469167c694c552556632/] 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-60469167c6ecc376659337/] Parameters ch is primitive character type. Return type return type is char. If char is already uppercase then it will return same. [crayon-60469167c6ed2177543365/] 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-60469167c735e215527307/] Parameters ch is primitive character type. Return type boolean is primitive character type. [crayon-60469167c7363146529151/] When you run above program, you will get below output: true true false false That’s all about java Character’s isletter method.

  • 20 January

    Program to find frequency of characters in a string in java

    In this tutorial, we will see simple program to find frequency of characters in a string in java. There are multiple ways to solve this proble. Let’s see one by one. Using counter array Here is the algorithm for the same. Initialize counter array of 256 length Iterate over String and increase count by 1 […]

  • 19 January

    Java Program to Check Whether a Character is Alphabet or Not

    This tutorial provides Java Program to Check Whether a Character is Alphabet or Not. [crayon-60469167c7d9d442795276/] Output: Enter a Character : d d is an alphabet. The ASCII value of lowercase alphabets range from 97 to 122. And, the ASCII value of uppercase alphabets range from 65 to 90. That’s why, we compared variable character between […]

  • 19 January

    Java Program to check a Character is Vowel or Consonant

    In this post, we will see how to check a Character is Vowel or Consonant. You just need to check if character is part of set {a,A,e,E,i,I,o,O,u,U}.If it is part of set then it is Vowel else Consonant. [crayon-60469167c8143416950405/] Output: Enter an Alphabet : g g is a Consonant That’s all about Java Program to […]