-
KFisher replied to the topic Java String in the forum Java J2EE Programming 6 years, 6 months ago
You can create String in Java using two methods.
1. Using String literal
Example:
String str1=”Welcome”;
String str2=”Java”;2. Using “new” keyword
Example:
String str1=new String(“Welcome”);
String str2=new String(“Java”);