我是从一开始就做错了,还是我只是没有意识到我需要做些什么才能将字符串转换为 int 并找到月份部分?
import javax.swing.JOptionPane;
import java.util.Scanner;
public class GoodDateBook
{
public static void main(String[]args)
{
Scanner kybd = new Scanner(System.in);
String allInput = JOptionPane.showInputDialog("Enter a date in the form mm/dd/yyyy");
String monthDayYear = kybd.nextLine();
int month2 = monthDayYear.indexOf("/");
int month = ?