I have a question about java compilation or sequence of java file compilation.
Question – I have a small object oriented program where I have three classes. I wrote java code for the biggest one where I am creating the objects for other two classes and invoking the methods from other two classes. other two classes are very small. When I compiled the first class file (without writing other two class files), I got few compilation error messages. Then I wrote both new class files (but I didn’t compile them, only .java files), my first class file compiled fine.
–So I want to understand, do I need to compile all the Java files to get all object references in those classes working or just writing java files is fine to compile any of these?
If you compile the one that refers to all the others, they will be compiled automatically as soon as Compiler encounters them in your code.