G 54 PRG Programming Lecture 3 Java Programming
















- Slides: 16
G 54 PRG Programming Lecture 3 Java Programming Language Amadeo Ascó Adam Moore 1
Previously • What is a programming language? – Set of grammatical rules for instructing a computer to perform specific tasks • Languages by implementation – Machine language; Assembly language – Compiled languages; C, C++ – Interpreted languages; Java • Language by paradigm • Simple initial design – Divide project into smaller and simpler subprojects – Pseudocode Amadeo Ascó , Adam Moore 2
Overview • • • What’s Java? Some history Characteristics Components Type of programs Development Amadeo Ascó , Adam Moore 3
What’s Java? Java is a programming language • Created by Sun Microsystems • Often used for web programming – Initially marketed as a web development system – Java is not only for web programming • General purpose programming language • Very similar to C++ – simplified! Amadeo Ascó , Adam Moore 4
What Else? NOT JAVASCRIPT!!!! Amadeo Ascó , Adam Moore 5
Some history • James Gosling - Sun – Started 1991, Launched 1995 – "write once, run anywhere" WORA • There were five primary goals : – – – It should be "simple, object oriented, and familiar". It should be "robust and secure". It should be "architecture neutral and portable". It should execute with "high performance". It should be "interpreted, threaded, and dynamic". • NOT Licensed to Microsoft - $20 M Amadeo Ascó , Adam Moore 6
Current 'Flavours' • Java SE – Standard Edition • Java EE – Enterprise Edition – Servlets • Java ME – Micro Edition – Optimised for mobile devices Amadeo Ascó , Adam Moore 7
Characteristics • • Object Oriented Concurrent Interpreted Modular – There's a library for (nearly) everything! • Internationalization - utf 8 native • Memory Management • Error Handling Amadeo Ascó , Adam Moore 8
Components Byte Code Virtual Machine Operating System Hardware Amadeo Ascó , Adam Moore 9
Development / Distribution • JDK – Development Toolkit – Compiler – Header Files • JRE – Runtime Environment – Just what's needed to execute bytecode Amadeo Ascó , Adam Moore 10
Type of programs • Applications – Has an entry point; static main method – Runable in a computer with JVM Storage Library(y) Library (y) Application JVM OS Amadeo Ascó , Adam Moore 11
Type of programs • Applets – GUI applications – Applet is a program written in the Java that can be included in an HTML page Applet Storage Web Server Library(y) Library (y) Browser OS Amadeo Ascó , Adam Moore 12
Type of programs • Servlets – Applications that run on the server side, so has an entry point – Normally used to extend functionality of a Web Library Storage Servlet Web Server JVM OS Amadeo Ascó , Adam Moore 13
Type of programs • Libraries – Re-usable code – Cannot be run by itself; doesn’t have an entry point Storage Library(y) Library (y) Application JVM OS Amadeo Ascó , Adam Moore 14
Development • Java Development Kit (JDK) http: //www. oracle. com/technetwork/javase/download s/index. html • Eclipse Development Environment Penumbra is in http: //wiki. eclipse. org/Eclipse_IDE_for_Education • Documentation for Java libraries http: //download. oracle. com/javase/6/docs/api/ • Tutorial http: //download. oracle. com/javase/tutorial/index. html Amadeo Ascó , Adam Moore 15
Eclipse • • • Rapid Application Development Very Powerful Most commonly used RAD today For (just about) all Languages Can be very complex So - we are using Penumbra – Special Educational Edition Amadeo Ascó , Adam Moore 16