I have a class like this:

public class Solution { public static List<Person> allPeople = new ArrayList<Person>(); static { allPeople.add(Person.createMale("Иванов Иван", new Date())); //сегодня родился id=0 allPeople.add(Person.createMale("Петров Петр", new Date())); //сегодня родился id=1 } private static Person getPerson(String name, String sex, String bd) throws ParseException { Person person = null; SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd/MM/yyyy", Locale.ENGLISH); if(sex.equals("м")) person = Person.createMale(name, simpleDateFormat.parse(bd)); else person = Person.createFemale(name, simpleDateFormat.parse(bd)); return person; } public static void main(String[] args) throws ParseException { //start here - начни тут if (args[0].equals("-c")) { Person person = getPerson(args[1], args[2], args[3]); allPeople.add(person); } else if (args[0].equals("-u")) { Person person = getPerson(args[2], args[3], args[4]); int id = Integer.valueOf(args[1]); allPeople.remove(id); allPeople.add(id, person); } else if (args[0].equals("-d")) { allPeople.remove(Integer.valueOf(args[1])); } else if (args[0].equals("-i")) { Person person = allPeople.get(Integer.valueOf(args[1])); System.out.println(person.getName() + " " + person.getSex() + " " + person.getBirthDay()); } } } 

My program accepts input from the command line. How to run a program with arguments in IntelliJ IDEA? Do not collect the jar for me every time to check ....

    1 answer 1

    Run / Debug -> Edit Configuration enter image description here

    enter image description here