write my assignment 8789
1. A showCharMethod
Write amethodnamed showChar. Themethod should accept twoarguments : areference to
aStringobject and aninteger . Theintegerargument is acharacter position within the
String , with the firstcharacter being at position 0. When themethod executes, it should
display thecharacter at thatcharacter position. Themethod does not return anything.
Here is an example of a call to themethod :
showChar(“New York”, 2);
In this call, themethod will display thecharacter w because it is in position 2. Demonstrate
themethod in a completeprogram .
showChar(“New York”, 2);In this call, the method will display the character w because it is in position 2. Demonstratethe method in a complete program .