How to add classes in Java?
I have kept the Main class, but when i try to change the name I get a error. Also, if i try to add classes (And I keep the Main class) I get a error stating that I have a duplicate class, however, I do not have two classes called by the same name. I have tried googling the problem but all examples of the problem are to hard for me to understand as i have just started out with Java.
you can add a class in java by creating a separate java file and with the class you want to import in it. Then simply call the class it does not require the import function.
Here is an example:
Thanks! I understand now how to add classes. Earlier I was a bit confused about the files, but I understand them now.