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 at position 0. When the method executes, it should display the character at that character position.
This is what I have so far:
public class ShowCharMethod
{
public static void showChar
char letter;
String name = "showChar";
letter = name.charAt();
public static void main(String[] args)
{
String testString = "New York";
showChar(testSt ring, 2);
}
}
This is what I have so far:
public class ShowCharMethod
{
public static void showChar
char letter;
String name = "showChar";
letter = name.charAt();
public static void main(String[] args)
{
String testString = "New York";
showChar(testSt ring, 2);
}
}
Comment