Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
School of Computer Science & Information Technology G6DICP - Lecture 2 The Java Programming Language Programming Languages 2 Formal languages in which computer programs are written All languages consist of syntax and semantics Low level languages - close to machine code High level languages - further removed from machine code Language Generations 3 First: Raw machine code Second: Assembly language (NB processor dependent) Third: High level languages (eg Java, C, Fortran, Cobol etc) Fourth: Application languages (eg SQL, Postcript Fifth: AI languages (expert systems, fuzzy logic, neural networks etc) Computer Programs 4 Computers are "stupid" Mathematical and logical instructions are executed very quickly and accurately. They obediently but stupidly do what you tell them to - not necessarily what you want them to! Tiny errors in a program can cause major problems when it is executed. Always remember syntax as well as semantics! Careful planning is essential Flow charts are a useful tool to represent program flow visually. Kettle-Boiling Program Is Kettle full? Yes Boil Kettle Make Tea 5 No Fill Kettle Components of Tea Making Program Fill Kettle Boil Kettle Place kettle under tap Place Kettle on hob Open tap Turn on heat Wait Wait No Is kettle full? Yes Close tap 6 Is kettle boiling? Yes Turn off heat Kettle-Boiling Program Fill Kettle Place kettle under tap Is Kettle full? No Open tap Wait No Is kettle full? Yes Yes Boil Kettle Place Kettle on hob Turn on heat Wait Is kettle boiling? Yes Turn off heat Make Tea 7 Close tap What is Java? Java is a programming language Java is not only for web programming 8 Created by Sun Microsystems Often used for web programming Initially marketed as a web development system General purpose programming language Very similar to C++ - simplified! Features of Java Originally developed for hardware devices. Platform Independent Binaries 9 Most operating systems Also hardware devices Robust and easy to use Object Oriented and highly modular Internationalisation Networking and Security features Java Model Byte Code Virtual Machine Operating System Hardware 10 Java VM Platforms Sun supported platforms Third party platforms (freely licensed) 11 Solaris Win32 (Windows 95/98 & NT) Linux “Hardware” Other Unix Mac OS Palm OS Symbian and many others Types of Java Programs Applications Applets Delivered over the Internet Require a Java capable WWW browser Servlets 12 Standalone programs Require a VM Require a Java capable WWW server Java Application Storage Source Code Byte Code CPU/memory Compiler Interpreter (VM) Program Execution 13 Java Applet Web Server 14 HTML Byte Code Web Browser Web Browser Program Execution (embedded in web page) Program Execution Development Software Java Developers Kit (JDK) Freely available from Sun for most platforms “no frills” development 15 Compiler - javac Interpreter - java Applet viewer - appletviewer Utilities (auto-documentation, debugging, optimisation etc) Java Runtime Environment (JRE) Integrated Development Environments / RAD Systems Flavours of Java JavaScript This is not Java! Java Versions Very obsolete Obsolete 16 JDK 1.1 Java 2 JDK 1.0 JDK 1.2, 1.3 & 1.4 Third party VM’s