Overload the multiConcat method from Exercise 7.4 such that if the integer parameter is not provided, the

Question:

Overload the multiConcat method from Exercise 7.4 such that if the integer parameter is not provided, the method returns the string concatenated with itself. For example, if the parameter is "test", the return value is "testtest"


Data From Exercise 7.4

Write a method called multiConcat that takes a String and an integer as parameters. Return a String that consists of the string parameter concatenated with itself count times, where count is the integer parameter. For example, if the parameter values are "hi" and 4, the return value is "hihihihi". Return the original string if the integer parameter is less than 2.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Java Software Solutions

ISBN: 9789353063610

9th Edition

Authors: John Lewis, William Loftus

Question Posted: