Discussions

General J2EE: Why JAVA file has extension as .Java and .class ???

  1. Why JAVA file has extension as .Java and .class ??? (4 messages)

    Everyone generally follows the conventional 3 letter extension but why java follows .java or .class also why not .oak ????
  2. You can't be serious. Maybe you should become a florist.
  3. Everyone generally follows the conventional 3 letter extension but why java follows .java or .class also why not .oak ????
    In that case, why does C use the extension "c" or "C", and "h" or "H" for sourcefiles? That's not 3 letters either... The 3 letter convention is a leftover from the olden days when that was all many operating systems supported. If you want that to remain, you should also demand that everyone write classes with names no more than 8 characters long as that was the norm in those same ancient times. If you go back even further, you should drop the extension completely and don't use directories either, as originally those didn't exist at all.
  4. not a language requirement[ Go to top ]

    Hi , This is not actually a language requirement, but it is an implementation requirement of many compilers, including the reference compilers from Sun. It is unwise to ignore this convention, because doing so limits the portability of your source files (but not, of course, your compiled files). -vijay.s.
  5. Re: not a language requirement[ Go to top ]

    It is simply because Sun decided to name the java files with a .java extenstion and a class file with a .class extension, and all the compliers/vendors adhere to the creatorsof java. May be some one will come up with a 010 extension for their version of java complier and a 000 extension for the class files for their VM. PLAINLY SPEAKING SUN CREATED JAVA , AND THEY DECIDED TO SPECIFY SOURCE FILES WITH A ".java" , AND A ".class" EXTENSION FOR THE CLASS FILES. AND NO ONE HVE DARED TO TRY OUT A DIFFERENT EXTENSION FOR THEIR VERSIONS OF COMPILERS ?VM's J