java program to print the specific character of the string given by user.
import java.util.;
import java.io.;
public class HelloWorld {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
String str=sc.nextLine();
int n=str.length();
//by finding the length of the string and then access
//the element by index.
System.out.println(str.charAt(n-1));
for(int i=0;i<n;i++)
{
System.out.println(str.charAt(i));
}
char[] ch=str.toCharArray();
/by creating char []array and initializing string
to the char array
then access the char array by index./
for(int i=0;i<n;i++)
{
System.out.println(ch[i]);
}
}
}