Download presentation
Presentation is loading. Please wait.
Published byAngel Harrington Modified over 9 years ago
1
J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program Design, Second Edition Second Edition D.S. Malik D.S. Malik
2
Java Programming: From Problem Analysis to Program Design, Second Edition 2 Chapter 1: An Overview of Computers and Programming Languages Chapter 1: An Overview of Computers and Programming Languages
3
Java Programming: From Problem Analysis to Program Design, Second Edition3 Evolution of Programming Languages High-level languages make programming easier. Closer to spoken languages. Examples: Basic FORTRAN COBOL C/C++ Java
4
Java Programming: From Problem Analysis to Program Design, Second Edition4 History Of Java Developed by Sun Microsystems – a company known for its workstations. Java is well known for developing internet applications. it is used to : Create web pages with dynamic and interactive content. Develop large –scale enterprise applications. Enhance the functionality of WWW servers. Provide applications for customer devices ( ex. Cell phones). Java program can run from a web browser.
5
Java Programming: From Problem Analysis to Program Design, Second Edition5 Basics of Java Environment The environment The language Java applications programming Interface AP Various class libraries
6
Java Programming: From Problem Analysis to Program Design, Second Edition6 Processing a Java Program Java program undergoes several stages : 1.Editing : use java code and save in a text file named className.java ( source program ). 2. Compiling : the compiler checks the source program for any syntax errors then translates the program into code understood by interpreter called bytecode saved in a file named className.class 3. Loading : the.class file must be loaded into computer main memory for execution and connect all classes. 4. Verifying : to validate and secure against damage. 5. Interprinting : the Interpreter Reads and translates each bytecode instruction into machine language and then executes it, one instrucion at a time.
7
Java Programming: From Problem Analysis to Program Design, Second Edition7 Processing a Java Program
8
Java Programming: From Problem Analysis to Program Design, Second Edition8 Processing a Java Program Java Virtual Machine (JVM): A hypothetical computer developed to make Java programs machine independent ( i.e run on many different types of computer platforms ). Bytecode is the machine language for the JVM.
9
Java Programming: From Problem Analysis to Program Design, Second Edition9 Processing a Java Program Two types of Java programs: applications : standalone programs stored and executed on a local computer. applets : a small program stored on a remote computer that users connect to via a WWW browser. applets are loaded into the browser, executed then discarded.
10
Java Programming: From Problem Analysis to Program Design, Second Edition10 Example of a Java Program A simple java application: an application executes using the java interpreter. Example : // This prints a line of text public class Welcome { public static void main (String args[] ) { System.out.println(“ welcome to java”) ; }
11
Java Programming: From Problem Analysis to Program Design, Second Edition11 Example of a Java Program // single line comment /* */ multiple line comment Every java program must have at least one class. Each class begins with a class declaration that defines data and methods for the class. The class name here is Welcome, and contains a method main () Welcome is an identifier.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.