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.

Slides:



Advertisements
Similar presentations
What is a Computer Program? For a computer to be able to do anything (multiply, play a song, run a word processor), it must be given the instructions.
Advertisements

Introduction To Java Objectives For Today â Introduction To Java â The Java Platform & The (JVM) Java Virtual Machine â Core Java (API) Application Programming.
Lab Information Security Using Java (Review) Lab#0 Omaima Al-Matrafi.
OBJECT-ORIENTED PROGRAMMING CONCEPTS (Review). What is an Object? What is an Object? Objects have states and behaviors. Example: A dog has states - color,
The road to reliable, autonomous distributed systems
Object Orientated Programming
JAVA Technology. Java Technology Java technology is a portfolio of products that are based on the power of networks and the idea that the same software.
What is an object? Your dog, your desk, your television set, your bicycle. Real-world objects share two characteristics: They all have state and behavior;
CS 501: Software Engineering Fall 2000 Lecture 16 System Architecture III Distributed Objects.
Created by Ron Beglieter (based on the Java Tutorial) 1 What is Java? Java technology is both a programming language and a platform; Programming Language.
Java Programming, 3e Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
Object-oriented Programming Concepts
CS884 (Prasad)Java Goals1 “Perfect Quote” You know you've achieved perfection in design, Not when you have nothing more to add, But when you have nothing.
Chapter 10 Application Development. Chapter Goals Describe the application development process and the role of methodologies, models and tools Compare.
Session-02. Objective In this session you will learn : What is Class Loader ? What is Byte Code Verifier? JIT & JAVA API Features of Java Java Environment.
Lecture 1: Overview of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++ Designed.
L EC. 01: J AVA FUNDAMENTALS Fall Java Programming.
01 Introduction to Java Technology. 2 Contents History of Java What is Java? Java Platforms Java Virtual Machine (JVM) Java Development Kit (JDK) Benefits.
Introduction to Java Programming. Contents 1. Java, etc. 2. Java's Advantages 3. Java's Disadvantages 4. Types of Java Code 5. Java Bytecodes 6. Steps.
JAVA v.s. C++ Programming Language Comparison By LI LU SAMMY CHU By LI LU SAMMY CHU.
INTRODUCTION TO WEB DATABASE PROGRAMMING
Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
Lecture 1 Introduction to Java MIT- AITI 2004 What is a Computer Program? For a computer to be able to do anything (multiply, play a song, run a word.
+ Java vs. Javascript Jessi Style. + Java Compiled Can stand on its own Written once, run anywhere Two-stage debugging Java is an Object Oriented Programming.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
CSCI 224 Introduction to Java Programming. Course Objectives  Learn the Java programming language: Syntax, Idioms Patterns, Styles  Become comfortable.
Understanding the CORBA Model. What is CORBA?  The Common Object Request Broker Architecture (CORBA) allows distributed applications to interoperate.
An intro to programming. The purpose of writing a program is to solve a problem or take advantage of an opportunity Consists of multiple steps:  Understanding.
Introduction to Java. 2 Module Information Programming conceptsPrerequisites Beginners in JAVATarget Audience This module will provide you a solid grounding.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Programming Languages Machine.
Introduction to Programming Languages. Problem Solving in Programming.
Why Java? A brief introduction to Java and its features Prepared by Mithat Konar.
1.  At the end of this slide, student can:  Explore tools, features, properties and interface of the Textpad.  Creating a new project.  Open and run.
Lecture 1 Introduction to Java MIT-AITI Ethiopia 2004.
Chapter 34 Java Technology for Active Web Documents methods used to provide continuous Web updates to browser – Server push – Active documents.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to.
Introduction and Features of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++
POS 406 Java Technology And Beginning Java Code
What Is Java? According to Sun in a white paper: Java: A simple, object-oriented, network-savvy, interpreted, robust, secure, architecture-neutral, portable,
National Taiwan University Department of Computer Science and Information Engineering National Taiwan University Department of Computer Science and Information.
Object Oriented Programming Concepts. Object ► An object is a software bundle of related state and behavior. ► Software objects are often used to model.
We will talking about story of JAVA language. By Kristsada Songpartom.
Copyright © Mohamed Nuzrath Java Programming :: Syllabus & Chapters :: Prepared & Presented By :: Mohamed Nuzrath [ Major In Programming ] NCC Programme.
JAVA Programming “When you are willing to make sacrifices for a great cause, you will never be alone.” Instructor: รัฐภูมิ เถื่อนถนอม
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
1. An Introduction A Programming Language A Technology Java Development Kit Java API One Language: Three Editions Standard Edition Enterprise Edition.
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, written in Java code, that.
What is Java? Object Oriented Programming Language Sun Microsystems “Write Once, Run Everywhere” Bytecode and Virtual Machine Java Platform (Java VM and.
Java – in context Main Features From Sun Microsystems ‘White Paper’
Lesson 1 1 LESSON 1 l Background information l Introduction to Java Introduction and a Taste of Java.
Java How to Program, 9/e Presented by: José M. Reyes Álamo © by Pearson Education, Inc. All Rights Reserved.
ITP 109 Week 2 Trina Gregory Introduction to Java.
Introduction to Programming 1 1 2Introduction to Java.
SESSION 1 Introduction in Java. Objectives Introduce classes and objects Starting with Java Introduce JDK Writing a simple Java program Using comments.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Fundamental of Java Programming (630002) Unit – 1 Introduction to Java.
Introduction to Algorithm. What is Algorithm? an algorithm is any well-defined computational procedure that takes some value, or set of values, as input.
Done By: Ashlee Lizarraga Ricky Usher Jacinto Roches Eli Gomez
Chapter 1 Introduction to Computers, Programs, and Java
Internet and Java Foundations, Programming and Practice
Java programming lecture one
Chapter 1 FOUNDATIONS OF JAVA
Getting Started ARCS Lab..
(Computer fundamental Lab)
F II 1. Background Objectives
Introducing Java.
Chap 1. Getting Started Objectives
Chap 4. Programming Fundamentals
Outcome of the Lecture Upon completion of this lecture you will be able to understand Fundamentals and Characteristics of Java Language Basic Terminology.
Presentation transcript:

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

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.

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.

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.

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.

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.

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.

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)

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.

The Java Platform

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.

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

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).

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

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.

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.

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

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.

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 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:\

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