String Handling: Introduction

In this blog, we will see introduction about String Handling process, currently we will just see how store value in String object.

For that, we use object passing, character array, byte array etc.

This topic is very easy then other java topics.


Let’s see String handling introduction example


class str1


                public static void main(String args[])


                                String str1 = “Welcome in Java String”;



                                String str2 = str1;              // Process 1

                                String str3 = new String(str1);     // Process2




                                char ch[] = {‘H’,’e’,’l’,’l’,’o’,’ ‘,’J’,’a’,’v’,’a’};

                                String str4 = new String(ch);        // also pass character array in string



                                String str5 = new String(ch,2,5); // 2-start index, 5-width of string | 5 character



                                byte b[] = {65,78,90,63,79};


                                String str6 = new String(b,1,3);   // 1 – start index , 3 – no of characters





Welcome in Java String

Welcome in Java String

Welcome in Java String

Hello Java

ll J



Video available on YouTube.


If you have any query on blog example, you can directly comment us or subscribe our website

Earn Money Online

996total visits,2visits today


Hello, I am Maddy a Java blogger, trainer and developer

Related articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Your comments (*)

Name (*)

Your full name please.

Email address (*)

Used for gravatar.


Link back if you want.

Enter Captcha Here :*

Reload Image