Skip to content
How to add classes in sperate file in JAVA repl?
Profile icon
OfirLiron

Hi I am new to repl with JAVA, and like to uderstand how to work with main and seperated class files

You are viewing a single comment. View All
Profile icon
SixBeeps

You can add files by clicking this button:
image

Just a reminder, however, your class names have to match your file names. For example, if you have a class called PlayerManager, it has to be in a file called PlayerManager.java

Profile icon
OfirLiron

Hi, I have tried but it seems to be problem
https://repl.it/@OfirLiron/Hiworld


@SixBeeps

Profile icon
SixBeeps

@OfirLiron
You have to add the .java extension

Profile icon
OfirLiron

Hi, can you please give an example?
if the class name is "isTimeAccurate" than I have to add .java in the and, it will turn the file to class?


@SixBeeps

Profile icon
SixBeeps

@OfirLiron
Yes, so the full file name should be isTimeAccurate.java

Profile icon
OfirLiron

Thanks a lot, really helped me

@SixBeeps

Profile icon
SixBeeps

@OfirLiron
You're welcome :)

Please mark my comment as the answer if I helped.

Profile icon
OfirLiron

I will be glad to do so, but can't find the button

@SixBeeps

Profile icon
OfirLiron

Ok I did it

@SixBeeps