SiteMap  | About    

How many ways we can create the string object?

There are various ways you can create a String Object in Java:

Using String literal

You can create String objects with String literal

Using new keyword

This is the common way to create a String object in java.

Using character array

You could also convert character array into String here

Java String Class

Java String Class represents character strings. The java.lang.String class provides a lot of methods to work on string. Java String is not a primitive data type like int and long. It is basically an object that represents sequence of char values . It is like an array of characters works same as java string.

More about... String Class (C) 2017    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.