Write a program to input your first name and last name and display them
together using string operator.
ANSWER TO BE BRAINLIEST!!!!!!! :)
Answers
Explanation:
System.out.println("Your first name is " + firstName + ", which has "
+ firstName.length() + " characters.");
System.out.println("Your last name is " + lastName + ", which has "
+ lastName.length() + " characters.");
System.out.println("Your initials are " + firstName.charAt(0) + lastName.charAt(0));
Or, using formatted output to make it easier to read:
System.out.printf( "Your first name is %s, which has %d characters.%n",
firstName, firstName.length() );
System.out.printf( "Your last name is %s, which has %d characters.%n",
lastName, lastName.length() );
System.out.printf( "Your initials are %s%s%n",
firstName.charAt(0), lastName.charAt(0) );