Presentation is loading. Please wait.

Presentation is loading. Please wait.

IB Computer Science II Paul Bui

Similar presentations


Presentation on theme: "IB Computer Science II Paul Bui"— Presentation transcript:

1 IB Computer Science II Paul Bui
Introduction to Java IB Computer Science II Paul Bui

2 What does a computer look like?
Central Processing Unit (CPU) Memory

3 What is a computer program?

4 Assembly Language Also known as machine code/language or low-level language Example: ADD R1, R2, R3 SUB R1, R1, 1 MULT R3, R1, R2 Why can’t I run my PC programs on a Mac?!?!? Different from machine to machine

5 I Hate Tedious Stuff Old school programs
Invention of the high-level language ADD R1, R2, R3 SUB R1, R1, 1  D = B*(B+C-1) MULT R4, R1, R2 Waaaay easier to understand

6 Compilers Translates or converts a high-level language (e.g., Java, C++) to a low-level language Does other stuff too! Checks syntax Optimizations and more! One would say, “Yeah, so I compiled my code to an executable or binary”

7 Before Java… Applications or Programs
Operating System (Windows XP, Mac OSX, etc.) Hardware (CPU + Memory + etc.)

8 How Java Works Java Application or Java Program
Java Runtime Environment or Java Virtual Machine Operating System (Windows XP, Mac OSX, etc.) Hardware (CPU + Memory + etc.)

9 What does this mean? Java bytecode (Java’s low-level language)
Java sourcecode (high-level)  Java bytecode (low-level)  assembly Two different operating systems with the JRE or JVM can run the same Java program

10 Ok, so I want to program now!
//My first Java program! class HelloWorld{ public static void main(String[] args) { System.out.println("Hello World!"); }

11 How to Compile and Execute
Open a text editor (gedit, tea, vi, etc.) Code Code Code Save file as CLASSNAME.java Example: HelloWorld.java Open a terminal javac HelloWorld.java java HelloWorld


Download ppt "IB Computer Science II Paul Bui"

Similar presentations


Ads by Google