Presentation is loading. Please wait.

Presentation is loading. Please wait.

CT1513 Introduction To java © A.AlOsaimi.

Similar presentations


Presentation on theme: "CT1513 Introduction To java © A.AlOsaimi."— Presentation transcript:

1 CT1513 Introduction To java © A.AlOsaimi

2 What is Java Java is a programming language and computing platform first released by Sun Microsystems in 1995.  © A.AlOsaimi

3 Why? Java is the first programming language to deliberately embrace the concept of writing programs that can be executed on the Web. The Java language is accompanied by a library of extra software that we can use when developing programs. The library provides the ability to create graphics, communicate over networks, and interact with databases. The set of supporting libraries is huge. © A.AlOsaimi

4 Java vs. C++ Both Java and C++ are most popular object-oriented programming languages C++ was created at AT&T Bell Labs in 1979 Java was born in Sun Microsystems in 1990 The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities. © A.AlOsaimi

5 Java applications and applets
Applications – standalone Java programs Applets – Java programs that run inside web browsers © A.AlOsaimi

6 Compiling Java Programs
The Java compiler produces bytecode (a “.class” file) not machine code from the source code (the “.java” file). Bytecode is converted into machine code using a Java Interpreter Source Code Bytecode © A.AlOsaimi

7 Platform Independent Java Programs Compiling
You can run bytecode on any computer that has a Java Interpreter installed “Hello.java” “Hello.class” © A.AlOsaimi

8 Multipurpose Java Compiling
© A.AlOsaimi

9 Running The Program Running The Bytecode (the “.class” file) Class
Loader Running Bytecode Verifier Bytecode The Bytecode (the “.class” file) Interpreter JVM Operating System Hardware © A.AlOsaimi

10 The Java Virtual Machine Components
The Class Loader stores bytecodes in memory Bytecode Verifier ensures bytecodes do not violate security requirements Bytecode Interpreter translates bytecodes into machine language © A.AlOsaimi

11 The Java Virtual Machine
The class Loader, the Bytecode Verifier and Interpreter constitute the Java Virtual Machine (JVM). JVM is platform specific. The interpreter translates the bytecodes into specific machine commands. © A.AlOsaimi

12 Java Development Environment
Primary Memory . Disk Editor Compiler Class Loader Program is created in an editor and stored on disk in a file ending with .java. Compiler creates bytecodes and stores them on disk in a file ending with .class. Class loader reads .class files containing bytecodes from disk and puts those bytecodes in memory. Phase 1 Phase 2 Phase 3 Bytecode Verifier Bytecode verifier confirms that all bytecodes are valid and do not violate Java’s security restrictions. Phase 4 Interpreter Interpreter reads bytecodes and translates them into a language that the computer can understand, possibly storing data values as the program executes. Phase 5 Java Development Environment © A.AlOsaimi

13 Some Characteristics of Java
Object-Oriented Combines data and behavior into one unit objects Provides Data abstraction and encapsulation Decompose program into objects. Programs are collections of interacting and cooperating objects. Platform-independent Portable ”Write-once, run-anywhere” Secure The bytecode verifier of the JVM : checks untrusted bytecode controls the permissions for high level actions. Portable- the feature “Write-once-run-anywhere”, also have the standard data size irrespective of operating system or processor. Dynamic- the user can get the required files from a local drive or from a computer far away from the user, just by connecting with the Internet. Secure- The security manager, determines the accessibility options of a class like reading and writing a file to the local disk. Java uses the public key encryption system to allow the java applications to transmit over the Internet in the secure encrypted form © A.AlOsaimi

14 Example of Java Programming Code
© A.AlOsaimi


Download ppt "CT1513 Introduction To java © A.AlOsaimi."

Similar presentations


Ads by Google