Using Java & Defining and Running Java Programs

A java program can be created using simple text editors such as the ubiquitous Notepad in Windows or TextEdit in Macs. Such programs are called editors. Editors cannot execute the programming code written on them. They are simply means of storing the program for future execution. There are other computer software that can be used to specifically aid a java developer to create and edit and manage complex and elaborate codes and algorithms. These programs offer a variety of features, to help a Java programmer organize their codes and files. A java program is a file with the “.java” extension (i.e. myJavaProgram.java). A Java program requires compilation using a program called a Java compiler. What a Java compiler does is to interpret the human-readable code written in the .java file and covert it to a file in bytecode. Basically, the human-readable instructions typed in a .java file are called a source code.

By using a java compiler, these instructions are converted and stored in bytes. Each of the class included in a java source code are separately encoded to a corresponding class file. For example, a .java file defining two classes- myClass and myOtherClass will compile into two files in bytecode, with the names myClass.class and myOtherClass.class, respectively. Files saved as .class lose their human readability, but are more compact and easier to distribute. However, there are ways to reverse engineer .class files back to a human-readable source code. Reverting bytecoded files back to its source code can be done by using decompilers. Decompilers themselves are not meant to steal the original codes of a program. As such, care and ethical concerns should always be considered when attempting to reverse engineer and extract information from someone else’s hard work.

Continue reading Using Java, Defining and Running Java Programs