I am a newbie and Java is my first language to try and learn thoroughly.
I am having an issue with "The Guessing Game" on page 38.
I understand this project is to make us visualize how the classes work together and using a test class, but they didn't label any of the files as a .java file??
I am using Atom Editor, (ALSO brand new to me but figured out how to get it to run correctly with path variables and added Kite!)
In order for the Atom Editor to run doesn't "GameLauncher.class" have to be GameLauncher.java, AND will Atom pull all the other classes (Player.class, GuessGame.class) as long as they are under the same folder in Atom?
I am not sure if this is more of an Atom Editor question or the need for the .java file. I guess I am just confused. I see how the classes all work together, but need to know how they all run smoothly in Atom.
I think, by the time they reached the guessing game, they took it for granted that you know you have to put the code into files called XYZ.java, and most of the time the file name has to match the class name. No, the XYZ.class doesn't have to be called YXZ.java. You need both, but it is possible to remove the XYZ.java file later. When the book was written, single file execution wasn't available, so you have to write the XYZ.java files and the javac tool (not the text editor) verifies the existence of the dependencies, e.g. PQR.class files, and will create all the necessary Something.class files if necessary if all the Something.java files can be found.
I am not familiar with Atom. I am presuming it is a text editor rather than an IDE (=Integrated Development Environment); IDEs usually call javac etc. for you and relay any error messages, etc.
Thanks. I thought using Kite in Atom (which isn't available in Eclipse) would really help, but I found it to be more a nuisance.
Atom has a slew of separate packages and add-ons you can use and I had to add a java compiler, turns out I like Eclipse.
Back to Eclipse as my go to IDE. And it creates the .java files automatically WHEN YOU ADD a class to the project.
In Atom I had a mix-up as to how to name the files for some reason... and the book had labeled the classes as .class at the ending of each of the classes(when they are really .java files which I would've had to name them in my source folder as such, (but classes to the project). It all makes sense!
Putting all this where and what the compiler is actually pulling together.