what is string manipulation in java? How to implement it?
Answers
Answered by
1
Answer:
String manipulation is a sequence of characters. They are widely used in Java. In java, strings are used to create objects. It is not a primitive type and is used to create and store immutable things. Simply you can take it as constant because you can't change it once created.
public class StringExample{
public static void main(String args[]){
String s1="java";//creating string by Java string literal.
char ch[]={'s','t','r','i','n','g','s'};
String s2=new String(ch);//converting char array to string.
String s3=new String("example");//creating Java string by new keyword
Similar questions
Computer Science,
12 hours ago
History,
12 hours ago
English,
12 hours ago
English,
1 day ago
English,
1 day ago
Political Science,
8 months ago
Math,
8 months ago