radian-software / riju

⚡ Extremely fast online playground for every programming language.

Home Page:https://riju.codes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Adding multiple classes in Java

reesericci opened this issue · comments

It would be nice if I could add multiple classes in my Java code, something I'm unable to do because Riju only supports one "file" (which I like), but Java requires making each class a new file. Maybe there's a workaround in the JVM to allow for multiple class declarations in one file?

Thanks,

--reese

You can do this by defining the additional classes as package-private (i.e., removing the public modifier): https://stackoverflow.com/a/48839136