Question: Write a Java program that will split the following string ( the code should be able to handle any number of commas ) and store

Write a Java program that will split the following string (the code should be able to handle any number of
commas) and store the elements in an Array or Array List:
String str = "Apple, Orange, Pear, Peach";
Your code will create an array of strings: {"Apple", "Orange", "Pear", "Peach"}
Now, write a code to create a new string from the array you just created:
String str2= "Apple--Orange--Pear--Peach";
Important: You cannot use any built-in methods of the String class.
Do at home:
Use the codes you developed to read lines (comma-separated) from the file input.csv darr and write the lines in a
file called output.txt in the format of the second string above.
 Write a Java program that will split the following string (the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!