CIS 35A: Introduction to Java Programming

Home | Green Sheet | Lectures | Assignments | FAQ

Introduction

Introduction
What you'll do in Java?

You type a source code file, compile it using the javac compiler, then run the compiled bytecode on a Java virtual machine.

  1. Source: Type your source code. Save as filename.java.
  2. Compiler: Compile the filename.java file by running javac filename.java. If you don't have errors, you'll get a second file named filename.class.
  3. Ouput: Compiled code: filename.class. The compiled-generated filename.class file is made up of bytecodes.
  4. Vitual Machines: Run the program by starting the Java Virtual Machine (JVM) with the filename.class. The JVM translates the bytecodes into something the underlying platform understands, and runs your program.

Introduction | History | How does Java work? | What you'll do in Java? | Code structure in Java | Anatomy of a class | The main() method