I\'m prompting the user to enter their first and last name but I can\'t figure out how to show just their first and last initials
import javax.swing.*; //import
If you want to show a message box like you were doing before, this should work:
JOptionPane.showMessageDialog(null, "Your initials are " + firstName.substring(0, 1) + " " + lastName.substring(0, 1));