+ 1

Java class library

Can we import this three ijava class and method library or whatever it's name in sololearn Java? import java.concurrent.Executors; import java.concurrent.ExecutorService; import java.concurrent ThreadPoolExecutor;

24th Dec 2021, 9:23 AM
Oliver Pasaribu
Oliver Pasaribu - avatar
6 Answers
+ 2
Sololearn have limited support for java libraries.. I think it can't support multi threads properly.. Just considers sequential flow instead of threads..
24th Dec 2021, 10:53 AM
Jayakrishna 🇮🇳
+ 2
Try it this way import java.util.concurrent.Executors; import java.util.concurrent.ExecutorService; import java.util.concurrent.ThreadPoolExecutor; You are missing the .util.
24th Dec 2021, 11:52 AM
Coding Cat
Coding Cat - avatar
+ 2
What is not working? I get all three classes Imported w/o any error. https://code.sololearn.com/cO51sBEGq9K0/?ref=app
25th Dec 2021, 8:54 AM
Coding Cat
Coding Cat - avatar
0
Ok, the hierarchy is not clear yet to me. I Will try it later. Thank you.
25th Dec 2021, 2:38 AM
Oliver Pasaribu
Oliver Pasaribu - avatar
0
It doesn't work. I have imported java.util.concurrent Executors and Java.util.concurrent.ExecutorService.
25th Dec 2021, 5:06 AM
Oliver Pasaribu
Oliver Pasaribu - avatar
0
Yes, But I tried not to use those 3 Java classes. Insrtead of import those classes, I juat import secure random generator to generate random numbers as timer for thread. I use conventional method for creating a thread by implementing Runnable interface, and it run successfuly.
26th Dec 2021, 3:34 AM
Oliver Pasaribu
Oliver Pasaribu - avatar