cs11-java-lec1

cs11-java-lec1 - CS11 – Java Fall 2008-2009 Lecture 1...

Info iconThis preview shows pages 1–10. 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

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: CS11 – Java Fall 2008-2009 Lecture 1 Welcome! ¡ 8 Lectures ¢ Slides posted on CS11 website ¢ http://www.cs.caltech.edu/courses/cs11 ¡ 8 Lab Assignments ¢ Made available on Tuesdays ¢ Due one week later – Tuesday, 12 noon ¡ CS Cluster Account ¢ Software environment (Java 1.6) ¢ Electronic submission ¡ ~/cs11/java/lab1 etc. Course Texts ¡ No textbook is required ¡ All necessary information is available online ¢ Extensive Sun Java API documentation ¢ Sun Java tutorials ¡ If you really want a book: The Java Programming Language , 4 th ed. Ken Arnold, James Gosling, David Holmes A Brief History of Java ¡ Developed by Sun Microsystems, starting in late 1990 ¢ Intended for embedded-systems programming ¢ Primary goal was improving on C++ ¢ Renamed to Java in 1994 ¡ Java 1.0 released in 1995 ¡ Numbering scheme changed with Java 5.0 ¢ (SDK/development version is still called 1.5) ¡ Current version is Java 6 (aka 1.6) A Brief History of Java (2) ¡ Language, and standard libraries, have expanded dramatically over the years ¢ Java 6 released in late 2006 – introduced many new language features, new APIs ¢ More language/library changes planned for Java 7 ¡ Java platform was made (mostly) open-source by Sun on May 2007 ¢ Facilitates more widespread adoption by software development teams ¢ Allows Java platform to be ported to, and customized for, additional hardware platforms Design Goals of Java Language ¡ Simple and familiar ¢ Based on C/C++, but with many of the subtleties removed. ¡ Object-oriented ¢ Well suited to distributed systems ¡ Architecture-neutral ¢ Both source code and binaries are portable ¡ Dynamic loading and binding ¢ Minimizes recompilations, and facilitates modularity! ¡ Secure ¢ Class verification, code signing, permissions ¡ Multithreaded ¢ Language specifies platform-neutral threading support How Java Does Its Thing ¡ Source code goes into .java files. ¡ One top-level class per file. ¡ Class’ name dictates file name. ¡ Example: HelloWorldApp.java // Display a message and then exit. public class HelloWorldApp { public static void main(String args) { System.out.println("Hello, world!"); } } How Java Does Its Thing (2) ¡ Java compiler takes .java files and compiles them into platform-independent .class files. ¢ javac HelloWorldApp.java Î produces HelloWorldApp.class ¢ These class files contain “byte-codes” – instructions for the Java Virtual Machine (JVM). ¡ Byte-codes for our example: public static void main(java.lang.String) 0: getstatic #2; //Field java/lang/System.out 3: ldc #3; //String "Hello, world!" 5: invokevirtual #4; //Method java/io/PrintStream.println 8: return How Java Does Its Thing (3) ¡ Run the program with a Java Virtual Machine (JVM) ¢ The JVM takes a class name, not the class’ filename > java HelloWorldApp Hello, world!...
View Full Document

This note was uploaded on 05/18/2010 for the course CS 11 taught by Professor Pinkston,d during the Spring '08 term at Caltech.

Page1 / 37

cs11-java-lec1 - CS11 – Java Fall 2008-2009 Lecture 1...

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

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