Computer Science, asked by Vickyvic3392, 1 year ago

How to create String object in Java?

Answers

Answered by PiyushSinghRajput1
4

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

Using String literal. You can create String objects with String literal. String str="Hello!";

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.

Answered by Oreki
1

String object_name = new String( );

Similar questions