Q:

write java program to print the last character in a given string

0

write java program to print the last character in a given string using the function charAt()

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

public class Main {
public static void main(String[] args) {   
 
    String s="hello";
    System.out.println(s.charAt(s.length()-1));
   }
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now