Presentation is loading. Please wait.

Presentation is loading. Please wait.

Creating Your First Computer Program in Java Margaret Yau.

Similar presentations


Presentation on theme: "Creating Your First Computer Program in Java Margaret Yau."— Presentation transcript:

1 Creating Your First Computer Program in Java Margaret Yau

2

3 Impacts of Software - Microsoft: the world’s largest software company - company worth $36 billion (2008) - over 400 million copies of Windows XP sold - the largest social networking site - company worth $3.75 – 5 billion - more than 200 million active users Can you even imagine a day without using software? - over 21 million iPhones sold - 50,000 applications available for download The Internet WWW - over 109.9 million active websites - estimated 1.5 billion Internet users (~ 5 x U.S. Population) - 14.3 billion searches by Americans in May 09

4 Computer programming is fun and powerful "I'm not coming down for dinner, didn't you read my blog ?!?!" And it is not just for nerds

5 Creating Your First Program in Java – High-level – Object-oriented programming (OOP) language – Platform-independent – Free and open-source

6 Three Important Parts of Computer Programming Coding Compiling Testing

7 1. Coding Source Code: collection of statements or declarations written in some human-readable computer programming language A high-level way of communicating with the computer Java: System.out.println(“How are you?"); English: Print the string “How are you?” to the computer screen.

8 class Hello { public static void main ( String[] args ) { System.out.println("Hello World!"); } Define a type of object (class) Class name Define the main behavior (method) A statement that prints “Hello World!” to the main output device Coding Your “Hello World!” Java Program

9 .java

10 2. Compiling A compiler translates source code in a high- level language to code in a low-level language that a particular type of machines understands (often binary form) Source code (Hello.java) Source code (Hello.java) Compiler (javac) Compiler (javac) Object code (Java bytecodes: Hello.class) Object code (Java bytecodes: Hello.class) class Hello { public static void main { System.out.println… 10001010 01010011 01010011 11110101 11110101 10010101 10010101

11 Compiling Your Java Program Hello.java javac Hello.class Source CodeCompilerObject Code javac

12 3. Testing Execute the program Find software bugs (error, mistake, or failure) Verify that the program meets its requirements Machine Processor Object code

13 3. Testing Execute the program Find software bugs (error, mistake, or failure) Verify that the program meets its requirements

14 Executing (Running) Your Java Program java Yay! I ran my first Java program!

15 You have coded, compiled, and tested your first computer program in Java.

16 What’s Next Software can be designed to perform almost anything computable. Observe and ask what people need, and use your imagination… e.g. program -that really understands natural language - that computes one quadrillion (10 15 ) digits of π -that reads your mind -that creates original and artistic songs and poetry

17 And you may be the next … Mark Zuckerberg Facebook Bill Gates Microsoft Steve Jobs Apple Larry Page Sergey Brin Google

18 Questions?


Download ppt "Creating Your First Computer Program in Java Margaret Yau."

Similar presentations


Ads by Google