Guess what? Java is a object orientated language! So you may not really know what on earth that means but it does play a big part on how Java stores files. There are two main types of files Java uses (ignoring things JAR and WAR files, hey we got to start somewhere!).

  1. Java files - Java source code (the stuff you write)
  2. Class files - Bytecode (compiled Java code).

Being object orientated Java uses classes and objects. Every class must be stored in a seperate file. The name of the file MUST match the name of the class. Also Java organises code in packages (we will go over this later). Each package will have it's own folder and if a class is in package X then it must be stored in folder X.

class file next Java JDK >>

 
Install
Menu
Search