Answer:
JOptionPane.showConfirmDialog() function with the option_type parameter set to JOptionPane.YES_NO_OPTION
Step-by-step explanation:
JOptionPane is a java swing class which enables users to display different kinds of standard dialog boxes such as - InputDialog, MessageDialog, ConfirmDialog or OptionDialog.
In order to display a Yes/No confirmation we can use JOptionPane.showConfirmDialog() function. This function takes a parameter called option_type. In order to display Yes/No options for the confirmation dialog, the option_type parameter needs to be set to the value JOptionPane.YES_NO_OPTION.