Skip to content
Sign UpLog In
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs
9

Creating and running a public class

golazo08
golazo08

Why does my public class SecondClass not run? Do I always have to use public Main? What if I want to create and run a public class?

3 years ago

Voters

Comments

TopNew
3
vedprad1
vedprad1

You can only run the Main class. If you want to run another class, you have to use Objects.

3 years ago
3
Geocube101
Geocube101

I can't seem to see or find your code, but the Main.java file must contain a Main class and a main function for it to run. You can create other classes and run them from main though.

3 years ago
Load more