+ 1

Write a code in java to print your first letter of your name..??

example: my name is rajesh sahu then i will make program for the write R...

13th Aug 2017, 1:38 PM
Rajesh Sahu
Rajesh Sahu - avatar
3 Answers
0
System.out.println("Boris".charAt(0)); Edit: import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String name = scan.nextLine(); char ch = scan.nextLine().charAt(0); System.out.println(name); name = ch + name.substring(1); System.out.println(name); } }
13th Aug 2017, 1:46 PM
Boris Batinkov
Boris Batinkov - avatar
0
sorry.....i m not saying that.......i say that you make the first letter of your name with the symbol (as your choice)..
13th Aug 2017, 1:49 PM
Rajesh Sahu
Rajesh Sahu - avatar
0
Your code is not working make some changes please and post here Thanks!
6th Oct 2020, 6:42 PM
Anugrah Singh
Anugrah Singh - avatar