Q:

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

belongs to collection: Java String Solved Programs

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)

Java String Solved Programs

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
<< write java program to convert the first character ...