Q:

Write a program to display first letter in your name then four letters later or before

0

Write a program to display first letter in your name then four letters later or before

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) {
		
		//WRITE A java PROGRAM TO DISPLAY FIRST LETTER IN YOUR NAME THEN FOUR LETTERS LATER OR BEFORE
		String name="adnan";
		System.out.println(name.charAt(0));
		
		System.out.print(name.charAt(1)+", "+name.charAt(2)+", "+name.charAt(3)+", "+name.charAt(4));
		
	}
}

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

total answers (1)

Similar questions


need a help?


find thousands of online teachers now