Hi everyone,
I’am quite new to this website, and, well, to object programming too !
I’ve decided to learn OOP with Java, and to practice Java here.
However, I do not really understand if it is possible to do OOP here with Java, and how to do it.
For example, in the current challenge Ghost in the cell, I have this:
class Player{
public void main{
blablabla
game loop while()
}
So, if I want to build objects, I need a new class defining my objects right ? But it occurs to me i can not do that in the same file, and I don’t know how to do it otherwise ? (maybe define a package and import ?? is it even possible ?)
Or, I must define my objects in the same class Player ? Meaning that my objects must be called Player ? Can I rename the class ? Anyway, if this work, I should then define my class methods et other methods before the main method and then use them in the game loop ?
Final question: given the relative simplicity of the data structure involved in the puzzles here, is it even useful to use objects ? Or should I just stick to classical variables and subroutines ?
Thanks a lot for your answers !