I opened a past task to check something and when I opened this one again, when I tried to run it, it gives an error:
Error:Module '1.JavaSyntax' production: java.lang.ClassCastException: class org.jetbrains.jps.builders.java.dependencyView.TypeRepr$PrimitiveType cannot be cast to class org.jetbrains.jps.builders.java.dependencyView.TypeRepr$ClassType (org.jetbrains.jps.builders.java.dependencyView.TypeRepr$PrimitiveType and org.jetbrains.jps.builders.java.dependencyView.TypeRepr$ClassType are in unnamed module of loader java.net.URLClassLoader @2ff4acd0)
Before it was running just fine. Does anybody know what happened?
package com.codegym.task.task07.task0713;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
/*
Playing Javarella
*/
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
ArrayList<Integer> list1 = new ArrayList<>();
ArrayList<Integer> list3 = new ArrayList<Integer>();
ArrayList<Integer> list2 = new ArrayList<Integer>();
ArrayList<Integer> list4 = new ArrayList<Integer>();
// Get 20 strings from the keyboard
for(int x = 1; x <= 20; x++){
int y = Integer.parseInt(reader.readLine());
list1.add(y);
if (x % 3 == 0 && x % 2 == 0){ // Check that the remainder is zero when divided by 3 and 2
list3.add(x); // Add to list3
list2.add(x); // Add to list2
}
else if (x % 3 == 0) // Check that the remainder is zero when we divide by three
list3.add(x); // Add to list3
else if(x % 2 == 0) // Check that the remainder is zero when we divide by two
list2.add(x); // Add to list2
else // All other numbers go to list4
list4.add(x);
}
printList(list3);
printList(list2);
printList(list4);
}
public static void printList(List<Integer> list) {
//write your code here
for(int x = 0; x < list.size(); x++){
System.out.println(list.get(x));
}
}
}