Programming Principles using - PowerPoint PPT Presentation

1 / 35
About This Presentation
Title:

Programming Principles using

Description:

Inventor James Gosling at Sun Microsystems in 1991 as part of Stealth, then Green Projects ... James Gosling Java's inventor. Java is fun. Java Virtual Machine ... – PowerPoint PPT presentation

Number of Views:144
Avg rating:3.0/5.0
Slides: 36
Provided by: michae332
Category:

less

Transcript and Presenter's Notes

Title: Programming Principles using


1
Programming Principles using
  • Michael Ulman

2
Programming Principles using Java
  • Course Organiser Michael Ulman
  • Tower Hill room 217
  • email m.ulman_at_londonmet.ac.uk
  • phone 0207 320 1723

3
Course Outline
  • Introduction to Java and Object Oriented Concepts
  • Java Virtual Machine
  • BlueJ
  • Identifiers, Data Types Variables
  • Arithmetic programming
  • Decisions
  • Control Structures
  • Methods
  • Applets
  • Java GUI

4
Assessment
  • Coursework 12
  • 4 exercise solutions (3 each)
  • a major exercise is one of these exercises
  • Final Examination 88
  • 2 hours
  • section A a test of understanding of elementary
    Java
  • section B based on the major exercise solution

5
Textbook
6
Other Books
  • Teach Yourself Java Chris Wright
  • Java Simplified Adam Shaw
  • Introductory Java David Parsons

7
Programming is about creating Software
  • What is software?
  • Where do we find software?
  • what kinds of software are there?
  • This is a PROGRAMMING course first.
  • Learning to program is a complex skill, we are
    going to learn some of the basics

8
Programs
  • What is a Program ?
  • Programs Data Algorithms
  • Algorithm set of step by step instructions
  • e.g a Recipe
  • Data as Input, Algorithm Processes the data and
    the Results are Output

9
first Java program source code
public class Hello public static void main
(String args) System.out.println(Hello
World)
10
Programming Languages
  • Machine Code language the processor understands
  • each processor has its own instruction set
  • written in binary 0s 1s
  • 1111010011010100

11
Program Development
source code
compilation
machine code
12
Java History
  • Inventor James Gosling at Sun Microsystems in
    1991 as part of Stealth, then Green Projects
  • Originally called Oak
  • For use on large distributed, network of
    consumer electronic devices all talking to each
    other

13
Java History
  • Javas first proposed use came in 1994 as an
    operating system for Interactive TV, this
    failed.
  • What came along that could use such a language ?
    One that
  • Works on many different platforms
  • Works on networked computers
  • Where security and reliability are important

14
Java History
  • World Wide Web applications for the Web
  • Java was announced at SunWorld 95
  • Netscape announced it would incorporate Java
    support in their browser, Microsoft followed suit
    with Internet Explorer

15
Microsoft the dominant platform
16
Java platform independent
17
James Gosling Javas inventor
18
Java is fun
19
Java Virtual Machine
  • JVM is a program that acts like a processor on
    which Java programs run
  • JVM is what makes Java programs portable
  • Write once run anywhere

20
Java Platform Independence
C source file Hello.c
C source file Hello.c
Java Source file Hello.java
COMPILATION javac Hello.java
COMPILATION
BYTECODE Hello.class
INTERPETATION on the Java Virtual Machine java
Hello
MACHINE CODE
MACHINE CODE
MACHINE CODE
MACHINE CODE
21
Java Development Kit
  • JDK is Suns free command line development
    environment
  • Java source files have a .java extension
  • Use javac myclass.java to compile your sourcefile
    to bytecode
  • Results in a file with a .class extension
  • To run your Java program on its interpreter java
    myclass

22
first Java program
public class Hello public static void main
(String args) System.out.println(Hello
World)
23
second Java program
  • import javax.swing.JOptionPane
  • public class Welcome
  • public static void main(String args)
  • JOptionPane.showMessageDialog(
  • null, Welcome\nto\nJava\nProgramming!,
    JOptionPane.PLAIN_MESSAGE)
  • System.exit(0)

24
Output of Welcome program
25
Running our first program
  • project Welcome is in U\CS1F03C\Week1\Welcome
  • copy project Welcome to the X or a floppy on A
  • To run BlueJ go to L\BlueJ
  • click on BlueJ.exe

26
BlueJ
L\BlueJ - click on BlueJ.exe
27
BlueJ - opening a project
28
BlueJ projects
29
BlueJ Design Window - Welcome class
30
BlueJ Editor Window source code
31
BlueJ selecting a method
32
BlueJ method call
33
BlueJ output window
34
BlueJ
  • www.BlueJ.org
  • Getting Started with Java
  • Getting Started at Home with Java
  • in U\CS1F03C

35
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com