Question: Java Programming Given a string return the first character in the string if it contains more than 4 characters, and the last character otherwise. firstOrLastChar(kwk)-
Java Programming

Given a string return the first character in the string if it contains more than 4 characters, and the last character otherwise. firstOrLastChar("kwk")- k firstOrLastChar("gals") 's' firstOrLastCharCuocrws")-'u' For example: Test Result System.out.println(firstorLastchar("qug"))g
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
