Java program to get the first letter of a string

Program

import java.io.*;
import
java.lang.*;
class test
{
public static void main(String[] args)
{
String a=”helloo”;
char first=a.charAt(0);
System.out.println(first);
}
}


Output

 h

Comments

Popular posts from this blog

Optical Charactor Recognition (OCR) in C#

How to create a transparent window in Windows Form Application

Installing MASM on Windows (32 bit or 64 bit)