Java Programming Question. Directions from the book - Write a method named showC
ID: 3761715 • Letter: J
Question
Java Programming 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);
3.The showChar method should accept two arguments.
4.Display the String valued entered, the position requested and the character found in that position, with descriptive labels.
5.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));
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.