Presentation is loading. Please wait.

Presentation is loading. Please wait.

About the Java  Java technology is both a programming language and a platform –The Java Programming Language A high-level language that can be characterized.

Similar presentations


Presentation on theme: "About the Java  Java technology is both a programming language and a platform –The Java Programming Language A high-level language that can be characterized."— Presentation transcript:

1 About the Java  Java technology is both a programming language and a platform –The Java Programming Language A high-level language that can be characterized as: –Simple –Object oriented –Distributed –Interpreted –Multithreaded –Robust –Secure –Architecture neutral –Portable –High performance –Dynamic

2 The Java Programming Language  Simple –Language that can be programmed without extensive programmer training. –Programmers can be productive from the very beginning.  Object Oriented & Distributed –Java technology provides a clean and efficient object-based development platform. –To complex functions, network-based environments, programming systems must adopt object-oriented concepts. –The needs of distributed, client-server based systems with the encapsulated, message- passing paradigms of object-based software.

3 The Java Programming Language  Interpreted –Most programming languages, usually compile or interpret a program so that they can work. –Java is a program that is both compiled and interpreted. –Java’s compiler, translate a program into an intermediate language called Java Bytecodes —the platform- independent codes interpreted by the interpreter on the Java platform.

4 The Java Programming Language  Robust –Java is designed for creating highly reliable software. –It provides extensive compile-time checking, followed by run-time checking. –The memory management model is extremely simple: objects are created with a new operator. –This simple memory management model eliminates entire classes of programming errors that bedevil C and C++ programmers.  Secure –Java is designed to operate in distributed environments, which means that security is of paramount importance. –Java lets programmers construct applications that can't be invaded from outside. –Applications written in Java are secure from intrusion by unauthorized code attempting to create viruses or invade file systems.

5 The Java Programming Language  Architecture Neutral & Portable –To accommodate the diversity of operating environments, Java compiler generates bytecodes. –Bytecodes -an architecture neutral format designed to transport code to multiple platforms. –The same Java byte codes will run on any platform.

6 The Java Programming Language  High Performance –Java achieves superior performance by adopting interpreter scheme that can run at full speed without needing to check the run-time environment.  Multithreaded –Java’s multithreading capability provides the means to build applications with many concurrent threads of activity.

7 The Java Programming Language  Dynamic –Java are dynamic in their linking stages.  Java classes are linked only as needed. –New code modules can be linked in on demand from a variety of sources, even from sources across a network. –Java interactive executable code can be loaded from anywhere.

8 About the Java –The Java Platform  A platform is the hardware or software environment in which a program runs.  Most platforms can be described as a combination of the operating system and hardware. –Windows –Linux –Solaris –MacOS.  The Java Platform is a software-only platform that runs on top of other hardware-based platforms.  The Java platform has two components: –The Java Virtual Machine (JVM) –The Java Application Programming Interface (Java API)

9 The Java Platform  The Java Virtual Machine (Java VM) –The Java VM is the base for the Java platform and is ported onto various hardware-based platforms.  The Java Application Programming Interface (Java API) –A large collection of useful and ready-made software components, such as Graphical User Interface (GUI). –Grouped into libraries of related classes and interfaces; these libraries are known as packages.

10 The Java Platform

11 Every full implementation of the Java platform gives the following features: –The essentials: Objects, strings, threads, numbers, input and output, data structures, system properties, date and time, and so on. –Applets: The set of conventions used by applets. –Networking: URLs, TCP (Transmission Control Protocol), UDP (User Datagram Protocol) sockets, and IP (Internet Protocol) addresses. –Internationalization: Help for writing programs that can be localized for users worldwide. Programs can automatically adapt to specific locales and be displayed in the appropriate language. –Security: Both low level and high level, including electronic signatures, public and private key management, access control, and certificates. –Software components: Known as JavaBeans TM, can plug into existing component architectures. –Object serialization: Allows lightweight persistence and communication via Remote Method Invocation (RMI). –Java Database Connectivity (JDBC TM ): Provides uniform access to a wide range of relational databases.

12 Object-Oriented Programming Concepts To be truly considered "object oriented", a programming language should support at a minimum four characteristics: –Encapsulation Implements information hiding and modularity –Polymorphism The same message sent to different objects results in behavior that's dependent on the nature of the object receiving the message –Inheritance Define new classes and behavior based on existing classes to obtain code re-use and code organization –Dynamic binding  Objects could come from anywhere, possibly across the network.  Object could be able to send messages to others objects without having to know their specific type.  Dynamic binding provides maximum flexibility while a program is executing

13 Object-Oriented Programming Concepts Basics of Objects Object technology is a collection of analysis, design, and programming methodologies that focuses design on modeling the characteristics and behavior of objects.  Examples of real-world objects: dog, desk, television set, bicycle.  Objects share two characteristics: –state –behavior  For example, –Dogs  state (name, color, breed, hungry)  behavior (barking, fetching, and wagging tail) –Bicycles  state (current gear, current pedal cadence, two wheels, number of gears)  behavior (braking, accelerating, slowing down, changing gears).

14 Object-Oriented Programming Concepts Basics of Objects (Continue…)

15 Object-Oriented Programming Concepts Basics of Objects (Continue…) –An object's behavior is defined by its Methods. –Methods manipulate the instance variables to create new state. –An object's instance variables (data) are packaged, or encapsulated, within the object and surrounded by the object's methods. –Objects interact and communicate with each other by sending messages to each other.

16 Object-Oriented Programming Concepts Classes –A class is not an object. –A class is a blueprint that defines how an object will look and behave when object is created from the class specification.

17 Object-Oriented Programming Concepts Inheritance –Object-oriented systems allow classes to be defined in terms of other classes. –Example: –Mountain bikes, racing bikes, and tandems are all subclasses of the bicycle class.subclasses –The bicycle class is the superclass of mountain bikes, racing bikes, and tandems.superclass –Each subclass inherits variable declarations and methods from the superclass.inherits

18 Object-Oriented Programming Concepts Inheritance (continue…) –The inheritance tree, or class hierarchy, can be as deep as needed. –Methods and variables are inherited down through the levels. –The farther down in the hierarchy a class appears, the more specialized its behavior. Polymorphism –Subclasses can also override inherited methods.override Overriding Providing a different implementation of a method in a subclass of the class that originally defined the method. –For example, A mountain bike with an extra set of gears will override the "change gears" method so that the rider could use those new gears.

19 Installation To write your program, you need: 1.The Java TM 2 Platform, Standard Edition.  Open: Oracle Java Webpage  Download file: jdk- -windows-.exe  Latest Version: jdk-7u25-windows-.exe  Java Documentation: jdk-7u25-apidocs.zip 2.A Text Editor. In example: Windows NotePad, Netbeans, Eclipse, etc. Netbean: Netbeans 7.3.1 3.Run the Java SDK (& Netbean) installer 4.Update the PATH variable – PATH C:\Program Files\Java\jdk1.7.0_ \ BIN – SET CLASSPATH C: \ Program Files\Java\jdk1.7.0_ \ LIB; C:\

20 First Java Program (w/o Netbean)  Write it in Notepad: public class Hello { public static void main(String[] args){ System.out.println("Hello World!"); }  Save the code to a file (in working folder): Example: HelloWorldApp.java  Open MS. DOS Prompt  Go to your working folder  Compile the Java Code file with javac.exe Example: c:\WorkDir\javac HelloWorldApp.java  Run The Bytecode file with java.exe Example: c:\WorkDir\java HelloWorldApp


Download ppt "About the Java  Java technology is both a programming language and a platform –The Java Programming Language A high-level language that can be characterized."

Similar presentations


Ads by Google