Introduction To JAVA By Ihtesham Ul Haq. Course Objectives Upon completing the course, you will understand Upon completing the course, you will understand.

Slides:



Advertisements
Similar presentations
A Programmer's Introduction to Java - from a S/370 user (c) IDMS/SQL News
Advertisements

INTRODUCTION Chapter 1 1. Java CPSC 1100 University of Tennessee at Chattanooga 2  Difference between Visual Logic & Java  Lots  Visual Logic Flowcharts.
L1-2:CSC ©Dr. Basheer M. Nasef Lecture #1 By Dr. Basheer M. Nasef.
University of Palestine software engineering department Introduction to data structures Introduction to java application instructor: Tasneem Darwish.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to.
Excerpts from Introduction to Java Programming, 4E Author: Y. Daniel Liang (Copyright by Prentice Hall)
Introduction to Java Programming, 4E
 2003 Prentice Hall, Inc. All rights reserved. Customized by Sana Odeh for the use of this class. 1 Introduction to Computers and Programming in JAVA.
Programming Software Applications Week 1 Dr. Xiaohong Gao Trent Park – B107, ext. 2252
1. 2 Chapter 1 Introduction to Computers, Programs, and Java.
01 Introduction to Java Technology. 2 Contents History of Java What is Java? Java Platforms Java Virtual Machine (JVM) Java Development Kit (JDK) Benefits.
Sadegh Aliakbary Sharif University of Technology Fall 2011.
BASIC JAVA PROGRAMMING TUTORIAL. History  James Gosling and Sun Microsystems  Oak  Java, May 20, 1995, Sun World  Hot Java –The first Java-enabled.
CTIS251-Week 1 Engineering Software and Java Dr. Ozlem Albayrak.
Introduction to Java Programming with JBuilder 4
S.W. Ma/CIM/LWL41211/2 Prog. IIA Page 1 HKIVE (Lee Wai Lee Campus) Department of CIM Course : Year 2 Module : Programming IIA Textbook : Introduction.
Chapter 1 Introduction to Computers, Programs, and Java 1.
Java Workshop for Teachers May 6, 2005 A Brief Look at the Java Programming Language.
Lecturer PEN PHIROM Tel : Web site: Lecturer PEN PHIROM Tel :
Sadegh Aliakbary Sharif University of Technology Spring 2011.
Sadegh Aliakbary. Copyright ©2014 JAVACUP.IRJAVACUP.IR All rights reserved. Redistribution of JAVACUP contents is not prohibited if JAVACUP.
LESSON 2 CREATING A JAVA APPLICATION JAVA PROGRAMMING Compiled By: Edwin O. Okech [Tutor, Amoud University]
Sadegh Aliakbary Sharif University of Technology Fall 2010.
Java Beserkers Group 4. Start of Java Development began on June of 1991 by a group of computer scientist at the Sun Mircrosystems Company Development.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Programming Languages Machine.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to Computers,
CPCS  Problem Solving in Everyday Life  Types of Problems  Problem Solving with Computers  Difficulties with Problem Solving 0-3.
1 Chapter 1 Introduction to Computers, Programs, and Java.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to Programs,
Introduction to Java Programming. History F James Gosling and Sun Microsystems F Oak F Java, May 20, 1995, Sun World F HotJava –The first Java-enabled.
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.
Sadegh Aliakbary Sharif University of Technology Fall 2012.
1 Part I : Chapter 01 Introduction to Java Programming.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
1 Chapter 3 Programs and Java. 2 Objectives F To review computer programs, and operating systems. F To represent numbers in binary, decimal, and hexadecimal.
ECOM 2314 Computer Programming I
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to.
Chapter 1: Introduction to Programs, and Java 1. Objectives To review programs (§ ). To understand the relationship between Java and the World Wide.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to Programs.
POS 406 Java Technology And Beginning Java Code
Intro and Review Welcome to Java. Introduction Java application programming Use tools from the JDK to compile and run programs. Videos at
Introduction to Java Programming with Forte Y. Daniel Liang.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved What is a Computer? A computer.
Object Oriented Rabie A. Ramadan, PhD Slides are exerted from different sources.
Introduction to Java Programming. Introduction Course Objectives Organization of the Book.
1 Chapter 3 Introduction to Computers, Programs, and Java.
FIRST JAVA PROGRAM. JAVA PROGRAMS Every program may consist of 1 or more classes. Syntax of a class: Each class can contain 1 or more methods. public.
Using Data Within a Program Chapter 2.  Classes  Methods  Statements  Modifiers  Identifiers.
SOFTWARE TECHNOLOGY - I JAVA/OOP Wickramanayake HMKSK Department of Electrical & Electronic Engineering Faculty of Engineering University.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to.
We will talking about story of JAVA language. By Kristsada Songpartom.
Application Architecture Using Java Hong Li. Introduction Developed by a team led by James Gosling at Sun Microsystem. Originally called Oak, designed.
What is Java? Object Oriented Programming Language Sun Microsystems “Write Once, Run Everywhere” Bytecode and Virtual Machine Java Platform (Java VM and.
Introduction Mehdi Einali Advanced Programming in Java 1.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to.
Introduction to Java Programming. 2 Chapter 1 Introduction to Java and Forte F What Is Java? F Getting Started With Java Programming –Create, Compile.
introductory lecture on java programming
Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved. 1 Chapter 1 Introduction to Computers, Programs,
Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved. 1 Chapter 1 Introduction.
Introduction to Java Programming, 4E Y. Daniel Liang.
SESSION 1 Introduction in Java. Objectives Introduce classes and objects Starting with Java Introduce JDK Writing a simple Java program Using comments.
Chapter 1 Introduction to Computers, Programs, and Java
Chapter No. : 1 Introduction to Java.
Java programming lecture one
Chapter 1 Introduction to Computers, Programs, and Java
Advanced Programming Fall 2017.
Chapter 1 Introduction to Computers, Programs, and Java
Anatomy of a Java Program
(Computer fundamental Lab)
By Rajanikanth B Overview Of Java By Rajanikanth B
Presentation transcript:

Introduction To JAVA By Ihtesham Ul Haq

Course Objectives Upon completing the course, you will understand Upon completing the course, you will understand Create, compile, and run Java programs Create, compile, and run Java programs Primitive data types Primitive data types Java control flow Java control flow Methods Methods Arrays (for teaching Java in two semesters, this could be the end) Arrays (for teaching Java in two semesters, this could be the end) Object-oriented programming Object-oriented programming Core Java classes (Swing, exception, internationalization, multithreading, multimedia, I/O, networking, Java Collections Framework) Core Java classes (Swing, exception, internationalization, multithreading, multimedia, I/O, networking, Java Collections Framework)

Course Objectives, cont. You will be able to You will be able to Write simple programs using primitive data types, control statements, methods, and arrays. Write simple programs using primitive data types, control statements, methods, and arrays. Create and use methods Create and use methods Develop a GUI interface and Java applets Develop a GUI interface and Java applets Write interesting projects Write interesting projects Establish a firm foundation on Java concepts Establish a firm foundation on Java concepts

History Of Java In January of 1991, Bill Joy, James Gosling, Mike Sheradin, Patrick Naughton and several other individuals met in Aspen, Colorado for the first time to discuss the ideas for the Stealth Project. The goal of the Stealth Project was to do research in the area of application of computers in the consumer electronics market. The vision of the project was to develop "smart" consumer electronic devices that could all be centrally controlled and programmed from a handheld-remote-control-like device. According to Gosling, "the goal was... to build a system that would let us do a large, distributed, heterogeneous network of consumer electronic devices all talking to each other." With this goal in mind, the stealth group began work In January of 1991, Bill Joy, James Gosling, Mike Sheradin, Patrick Naughton and several other individuals met in Aspen, Colorado for the first time to discuss the ideas for the Stealth Project. The goal of the Stealth Project was to do research in the area of application of computers in the consumer electronics market. The vision of the project was to develop "smart" consumer electronic devices that could all be centrally controlled and programmed from a handheld-remote-control-like device. According to Gosling, "the goal was... to build a system that would let us do a large, distributed, heterogeneous network of consumer electronic devices all talking to each other." With this goal in mind, the stealth group began work

History cont. Gosling thought that the C++ programming language used at that time was inadequate for this kind of a project. Gosling thought that the C++ programming language used at that time was inadequate for this kind of a project. His extensions and modifications to C++ were the first steps towards the development of an independent language that would fit the project objectives. His extensions and modifications to C++ were the first steps towards the development of an independent language that would fit the project objectives.

The Name Gosling named the language "Oak" while staring at an oak tree outside his office window! The name "Oak" was later dismissed. Gosling named the language "Oak" while staring at an oak tree outside his office window! The name "Oak" was later dismissed. Finally, inspiration struck one day during a trip to the local coffee shop". Finally, inspiration struck one day during a trip to the local coffee shop". Others have speculated that the name Java came from several individuals involved in the project: James gosling, Arthur Van hoff, Andy bechtolsheim. [McCarthy] Others have speculated that the name Java came from several individuals involved in the project: James gosling, Arthur Van hoff, Andy bechtolsheim. [McCarthy]McCarthy

Why Choose Java? Why Choose Java? Java is simple Java is simple Java is object-oriented Java is object-oriented Java is distributed Java is distributed Java is interpreted Java is interpreted Java is robust Java is robust Java is secure Java is secure Java is architecture-neutral Java is architecture-neutral Java is portable Java is portable Java’s performance Java’s performance Java is multithreaded Java is multithreaded Java is dynamic Java is dynamic

Java is Architecture Neutral! The most important of the advantages of java over others is that the Language is Architecture Neutral. The most important of the advantages of java over others is that the Language is Architecture Neutral. This means that a Program written in java can be run by “Any Machine” having “Any operating System”. This means that a Program written in java can be run by “Any Machine” having “Any operating System”.

How Does the Architecture Neutral Work?

Anatomy of a Java Program Comments Comments Package Package Reserved words Reserved words Modifiers Modifiers Statements Statements Blocks Blocks Classes Classes Methods Methods The main method The main method

Comments In Java, comments are preceded by two slashes (//) in a line, or enclosed between /* and */ in one or multiple lines. When the compiler sees //, it ignores all text after // in the same line. When it sees /*, it scans for the next */ and ignores any text between /* and */.

Package The second line in the program (package chapter1;) specifies a package name, chapter1, for the class Welcome. Packages are Groups of classes Located in a directory, child directory, and so on…. It is important to note that in a program we may include a package name or a sub package name.

Reserved Words Reserved words or keywords are words that have a specific meaning to the compiler and cannot be used for other purposes in the program. For example, when the compiler sees the word class, it understands that the word after class is the name for the class. Other reserved words are public, static, and void.

Modifiers Java uses certain reserved words called modifiers that specify the properties of the data, methods, and classes and how they can be used. Examples of modifiers are public and static. Other modifiers are private, final, abstract, and protected. A public datum, method, or class can be accessed by other programs. A private datum or method cannot be accessed by other programs.

Statements A statement represents an action or a sequence of actions. The statement System.out.println("Welcome to Java!") in the program in Example 1.1 is a statement to display the greeting "Welcome to Java!" Every statement in Java ends with a semicolon (;).

Blocks A pair of braces in a program forms a block that groups components of a program.

Classes The class is the essential Java construct. A class is a template or blueprint for objects. To program in Java, you must understand classes and be able to write and use them. The mystery of the class will continue to be unveiled throughout Java. For now, though, understand that a program is defined by using one or more classes.

Methods What is System.out.println? It is a method: a collection of statements that performs a sequence of operations to display a message on the console. It can be used even without fully understanding the details of how it works. It is used by invoking a statement with a string argument. The string argument is enclosed within parentheses. In this case, the argument is "Welcome to Java!" You can call the same println method with a different argument to print a different message.

main Method The main method provides the control of program flow. The Java interpreter executes the application by invoking the main method. The main method looks like this: public static void main(String[] args) { // Statements; // Statements;}

What tools to Use? JDK 6 JDK 6 The Java Development Kit Version 6 The Java Development Kit Version 6 Can be downloaded from Can be downloaded from TEXTPAD TEXTPAD IDE for Java Development IDE for Java Development Can be downloaded from Can be downloaded fromhttp://

Recommended Books Java 2 Java 2 Ivor Horton Ivor Horton Java Java Dietel and Dietel Dietel and Dietel