Question: java programming language . Write a method called collapseSpaces that takes a Scanner as a parameter. The method should output the contents of the Scanner

java programming language
. Write a method called collapseSpaces that takes a Scanner as a parameter. The method should output the "contents" of the Scanner collapsing any sequence of multiple spaces into a single space (or 0 spaces if at the start of a line). For example: Love Java! You should give the Scanner class a. a try becomes I Love Java! You should give the Scanner class a try. public static void collapseSpaces (Scanner s) f
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
