lecture05

Lecture05 - Computer Science 111 Lecture 05 Java CS111 Slides for Prof Steinbergs lecture Lecture 05 1 CS111 Slides for Prof Steinbergs lecture

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

View Full Document Right Arrow Icon
CS111: Slides for Prof. Steinberg ʼ s lecture 1 Lecture 05 Computer Science 111 Computer Science 111 Lecture 05 Java
Background image of page 1

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

View Full DocumentRight Arrow Icon
CS111: Slides for Prof. Steinberg ʼ s lecture 2 Lecture 05
Background image of page 2
CS111: Slides for Prof. Steinberg ʼ s lecture 3 Lecture 05 Practicalities Practicalities Java programs are made up of classes Often one class, but sometimes many Each class is in its own file Foo . java class Foo in the Java language Foo.java~ previous version of Foo.java Foo.class byte code, compiled from Foo.java
Background image of page 3

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

View Full DocumentRight Arrow Icon
CS111: Slides for Prof. Steinberg ʼ s lecture 4 Lecture 05 Foo.java javac Foo.class java Input Output
Background image of page 4
CS111: Slides for Prof. Steinberg ʼ s lecture 5 Lecture 05 A Simple Complete Program A Simple Complete Program public class HelloWorld{ public static void main(String [ ] args){ System.out.println("hello world"); } }
Background image of page 5

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

View Full DocumentRight Arrow Icon
CS111: Slides for Prof. Steinberg ʼ s lecture 6 Lecture 05 Identifiers Identifiers The name of a class must be an identifier That is: 1st character a letter Rest of characters letters or numbers Case matters: Foo and foo and fOo are all different
Background image of page 6
CS111: Slides for Prof. Steinberg ʼ s lecture 7 Lecture 05 Conventions Conventions Conventions: Don’t matter to computer Do matter to people Class names start with upper case Other identifiers start with lower case Each word after first capitalized aVeryLongIdentifier LbToKg
Background image of page 7

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

View Full DocumentRight Arrow Icon
CS111: Slides for Prof. Steinberg ʼ s lecture 8 Lecture 05 A Simple Complete Program A Simple Complete Program public class HelloWorld{ public static void main(String [ ] args){ System.out.println("hello world"); } } For now, magic incantations to start and end a java program
Background image of page 8
CS111: Slides for Prof. Steinberg ʼ s lecture 9 Lecture 05 A Simple Complete Program A Simple Complete Program public class HelloWorld{ public static void main(String [ ] args){ System.out.println("hello world"); } } Procedure call to print hello world on screen
Background image of page 9

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

View Full DocumentRight Arrow Icon
CS111: Slides for Prof. Steinberg ʼ s lecture 10 Lecture 05 Procedures Procedures A procedure is a predefined piece of a program that can be used (‘called’) in other programs.
Background image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 11/01/2011 for the course 198 111 at Rutgers.

Page1 / 38

Lecture05 - Computer Science 111 Lecture 05 Java CS111 Slides for Prof Steinbergs lecture Lecture 05 1 CS111 Slides for Prof Steinbergs lecture

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

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