Both are binary files but the differences between those are:-
1) we can execute an executable file while we cannot execute an object file.
2) An object file is a file where compiler has not yet linked to the libraries, so you get an object file just before linking to the libraries, so still some of the symbols or function definitions are not yet resolved which are actually present in the libraries, and that's why we cannot execute it.
Once an object file is linked with the library by the compiler, then all the symbols are resolved and we get an executable file which can be executed on the appropriate platform.
So basically the difference is that we get an object file when we don't link with library while executable file is with the linking phase.
Object code is an intermediate representation of code generated by a compiler after it processes a source code file(.java file) and Java bytecode is the form of instructions that the Java virtual machine executes.