+ 3
Can you have multiple source files for a program.
Hi everyone, how would you post a Java program with three classes on SoloLearn? Normally Java wants each class in a separate .java file. I usually have a source directory for all the .java files in a project. How would I post a Java program that has three classes and three .java files? The main class imports the two other classes it uses. does import on SoloLearn's Java playground support private imports for different parts of your program?
2 odpowiedzi
+ 4
Sololearn doesn't allow multiple source program, then you should pack all into a single file.
obviously, it's not a proper way to write code in Java
+ 1
There's also Reflection / dynamic class loading (not personally tested):
http://tutorials.jenkov.com/java-reflection/dynamic-class-loading-reloading.html
...if you reframe the "issue" as "how to work with the limited resources available in my Internet-of-Things-like" environment.