Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Directions from the book - Write a method named showChar . The method should acc

ID: 3761716 • Letter: D

Question

Directions from the book - Write a method named showChar. The method should accept two arguments; a reference to a Stringobject and an integer. The integer argument is a character position within the String, with the first character being at position 0. Here is an example of a call to the method:

showChar("New York", 2);

-The showChar method should accept two arguments.

-Display the String valued entered, the position requested and the character found in that position, with descriptive labels.

-Use the @param to describe the parameters

Explanation / Answer

void showChar(String s,int index){

   System.out.println(“Character at position “+index + “ of string is “+s.charAt(index));

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote