CMSC 150 INTRODUCTION TO COMPUTING CS 150: Wed 11 Jan 2012
Quote of the Day “A smartphone today has more computing power than all of NASA did when it put a man on the moon in 1969.” - Paul Otellini, Intel CEO Quoted from Michael J. Miller’s ForwardThinking blog
Homework, due Wednesday 1/18 p : 2, 3, 7, 9 p : 4, 6, 7, 8, 10, 11 p. 130: #4 and 5 (can be done on pencil and paper or as a BlueJ project - use project name hw1_ as your project name, and be sure to put your name in the comment at the top of the.java file if you do this in BlueJ) Bonus problem: p. 128: #6
Compiling & Executing Compiler Java Program (Source) Java Program (Source) Java Program (Source) Java Program (Source) Java Program (Byte Code) Java Program (Byte Code) Java Program (Byte Code) Java Program (Byte Code) Java Virtual Machine Java Virtual Machine You write the.java source code into a text file using an IDE, e.g., BlueJ
Compiler The compiler is a program that converts source to binary; Included as part of Java Java Program (Source) Java Program (Source) Java Program (Source) Java Program (Source) Java Program (Byte Code) Java Program (Byte Code) Java Program (Byte Code) Java Program (Byte Code) Java Virtual Machine Java Virtual Machine Compiling & Executing
Compiler Java Program (Source) Java Program (Source) Java Program (Source) Java Program (Source) Java Program (Byte Code) Java Program (Byte Code) Java Program (Byte Code) Java Program (Byte Code) Java Virtual Machine Java Virtual Machine The.class byte code file (binary) can be executed Compiling & Executing
Compiler Java Program (Source) Java Program (Source) Java Program (Source) Java Program (Source) Java Program (Byte Code) Java Program (Byte Code) Java Program (Byte Code) Java Program (Byte Code) Java Virtual Machine Java Virtual Machine Java VM is a program that executes byte code instructions on the CPU Compiling & Executing
RAM vs. Hard Drive
Your Program’s State Your.java source code file is saved to disk
Your Program’s State When you compile, the.class binary file is also saved to disk
Your Program’s State When you run the program, the Java VM loads the binary version into RAM…
Your Program’s State so that the instructions can be executed on the CPU
Let’s Move Into BlueJ…