• 24 May

    How to convert String to Byte array in java

    Sometimes, we need to convert String to byte array. We can use getBytes() method of String to do it, Method syntax: [crayon-600665f5e42fd558079648/] String getBytes Example: [crayon-600665f5e4304695783852/] When you run above program, you will get below output: [crayon-600665f5e4305671165385/] There is one more overloaded method for getBytes Method syntax: [crayon-600665f5e4307183841554/] It encodes String to specified charset format. […]

  • 04 May

    How to convert String to Char Array in java

    Java String’s toCharArray() method can be used to convert String to char Array in java. It is simplest method to convert String to char Array. Example: [crayon-600665f5e47ad778908093/] When you run above program, you will get below output: [crayon-600665f5e47b2685448092/] Other String Programs are : String : How to reverse String in java How to check if […]

  • 04 May

    How to convert Char Array to String in java

    There are multiple ways to convert Char Array to String in java. Some of them are: Using String class’s constructor (By passing Char array to contructor) Using String class’s valueOf method Using iterating char array Example: [crayon-600665f5e49e5736782033/] When you run above program, you will get below output [crayon-600665f5e49ea779282343/] Other String Programs are : How to […]