Hi guys,
I tried numerous variants of this code especially with " quotation marks
and without quotation marks for the last sentence!
What is wrong?
best regards
Fabian
package com.codegym.task.task08.task0828;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.TreeSet;
import java.util.List;
import java.util.LinkedHashSet;
import java.util.*;
/*
Month number
*/
public class Solution {
public static void main(String[] args) throws IOException {
ArrayList<String> monthList = new ArrayList<String>();
monthList.add("January");
monthList.add("February");
monthList.add("March");
monthList.add("April");
monthList.add("May");
monthList.add("June");
monthList.add("July");
monthList.add("August");
monthList.add("September");
monthList.add("Oktober");
monthList.add("November");
monthList.add("December");
int result = 1;
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String month = reader.readLine();
System.out.println("\"" + month + " is month " + (monthList.indexOf(month)+1)+"\"" +".");
}
}