Prepare a method that takes a string as input and returns a


Question: Prepare a method that takes a String as input and returns a String containing the middle character of the String if the length of that String is odd.

If the length of the String is even, your method should return the middle two characters.

For case, if the input String is "Hello" the method should return "l" and if the input String is "Worlds" the method should return "rl". In addition, prepare a main method that tests your method for a variety of String values.

The code must be error free and compile properly on first attempt.  Any code that does not do this will not be awarded points.

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Prepare a method that takes a string as input and returns a
Reference No:- TGS0958375

Expected delivery within 24 Hours