Ask Question
22 September, 03:33

Then create a new Java application called "StringSlicer" (without the quotation marks) that uses methods to:

Get a String from the user at the command line

Populate an ArrayList of Character data (the wrapper class), with each char in the String represented as a separate Character element in the ArrayList

Output each Character to the command line, each on a separate line

+5
Answers (1)
  1. 22 September, 06:51
    0
    See the explanation section

    Explanation:

    import java. util.*;

    //The above statement is to import the Scanner and ArrayList class

    public class StringSlicer {

    public static void main (String args[]) {

    Scanner scan = new Scanner (System. in);

    System. out. println ("Enter your string: ");

    String inputString = scan. nextLine ();

    ArrayList stringList = new ArrayList ();

    for (int i = 0; i < inputString. length (); i++) {

    stringList. add (inputString. charAt (i));

    }

    for (Character letter: stringList) {

    System. out. println (letter);

    }

    }

    }
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Then create a new Java application called "StringSlicer" (without the quotation marks) that uses methods to: Get a String from the user at ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers