Question: Write a method named showChar. The method should accept two arguments: a reference to a String object and an integer. The integer argument is a

Write a method named showChar. The method should accept two arguments: a reference to a String object and an integer. The integer argument is a character position within the String, with the first character being a position 0. When the method executes, it should display the characters at the character position. Here is an example of a call to the method:

showChar('New York", 2);

In this call, the method will display the character w beause it is in position 2. Demonstrate the method in a complete program.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!