Creating packages

I was checking one of your tutorials here One of the last paragraphs says:

Then you would export a .jar file that contains your code. Make sure your classes are in packages!

I think you could add a bit more why packages are important, specially if you are creating a jar. Another suggestion on this explanation is related to the last example you provided between the sketch and Ball class. The latter could be stored in the Ball.java file at the same level as the sketch.java file so for sketch.java to be able to see the Ball class.

Two small details to improve this docs.Other than that, this tutorials are very useful.

Kf

thanks for the feedback. I’ve added a sentence explaining why you need packages, but I wasn’t sure what you meant by moving the Ball class: do you mean making it an inner class of the MySketch class? If so, I think I want to keep them in separate classes, to give a more accurate picture of the Java way of thinking.

I see you added the extra comment related to packages which is great. My second comment above was related to the naming of the file Ball.java. However, now I noticed that the information is there in the eclipse folder layout section, where it shows the name of all the files. So never mind then.

Kf

Actually, I notice you talk about packages in the Java tutorials: Classes. Maybe introducing a link in the post would be useful, or at least it will satisfy all those keener like me :stuck_out_tongue:

Kf