02-java-programming-basics

02-java-programming-basics - Java Programming Basics CSE...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Java Programming Basics CSE 114: Computer Science I SUNY at Stony Brook 1 Outline of Topics The Java Environment Java Grammar A First Program Parts of a Java Program Compiling and Executing Java Code Experimenting With Code 2 The Java Development Cycle Standard edit-compile-execute cycle Compilation translates source code into a form that the computer can understand With Java, this is slightly more complicated than with other languages... 3 Two Faces of Java The name Java actually refers to two things: The programming language The Java Virtual Machine (JVM) In most languages, a compiled program runs directly on the hardware (it speaks the CPUs language) Java programs execute on a simulated CPU (the JVM). The real CPU runs a program that simulates this CPU. 4 Desktop PC Source Code is compiled by executes program on The Java Compilation Process 5 Java Compilation (Part 1) Desktop PC Source Code is compiled by executes program on Source Code 100111 101010 110011 000110 Java Bytecode Java compiler (javac) 6 Java Compilation (Part 2) Desktop PC Source Code is compiled by executes program on 100111 101010 110011 000110 Java Bytecode Java Virtual Machine (JVM) Desktop PC executes on which is simulated by 7 Why Is It So Complicated? With most languages, a program must be compiled separately for every type of CPU A new type of CPU requires another compilation Java programs are compiled to a fake CPU (the JVM) After one compilation, a Java program can run on any CPU that can run the JVM Write once, run anywhere reduces programmer effort 8 Outline of Topics...
View Full Document

Page1 / 25

02-java-programming-basics - Java Programming Basics CSE...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online