Ask coding questions

← Back to all posts
1
putting a class in a class file.
RebeccaHammack (0)

I have an assignment where I have to name the file the same name as the class. I can't use 'Main.java' . How can this be done in repl.it?

Commentshotnewtop
1
ash15khng (220)

Let's say the class is named Cat or something.
To create your file Cat.java, you would need to go to the side bar on the left and click the add file icon. Then name it Cat.java. Not sure how to run the code in there tho.

1
vedprad1 (470)
  1. Go to the right side bar.
  2. Click on the first icon.
  3. Go to the add file sign on the top.
  4. Create a new file.

If this answers your question, please check the checkmark on the left side of this message. Thanks and Good Luck!