BASIC JAVA PROGRAMMING TUTORIAL. History  James Gosling and Sun Microsystems  Oak  Java, May 20, 1995, Sun World  Hot Java –The first Java-enabled.

Slides:



Advertisements
Similar presentations
Liang, Introduction to Java Programming, Sixth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to.
Advertisements

IC211 Object Oriented Programming Overview of Java.
Java: History and Introduction (Lecture # 1). History… Java – Based on C and C++ – Developed in 1991 for intelligent consumer electronic devices – Green.
Introduction to Java Kiyeol Ryu Java Programming Language.
Excerpts from Introduction to Java Programming, 4E Author: Y. Daniel Liang (Copyright by Prentice Hall)
Introduction to Java Programming, 4E
Introduction to Java CS 331. Introduction Present the syntax of Java Introduce the Java API Demonstrate how to build –stand-alone Java programs –Java.
For more Lectures and Notes Visit
Unit2: Object-oriented programming Getting started with Java Jin Sa.
Programming Software Applications Week 1 Dr. Xiaohong Gao Trent Park – B107, ext. 2252
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
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.
Sadegh Aliakbary Sharif University of Technology Fall 2011.
Getting Started What is Java? A programming language –Fully buzzword-compliant: A simple, object oriented, distributed, interpreted, robust, secure,
Advanced OOP MCS-3 OOP BSCS-3 Lecture # 1
Lecture 1 An Introduction to Computer, Programming and Java 1.
Introduction to Java Programming with JBuilder 4
+ 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.
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.
Sadegh Aliakbary Sharif University of Technology Spring 2011.
Sadegh Aliakbary Sharif University of Technology Fall 2010.
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.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to.
1 Chapter 1 Java –Originally for intelligent consumer-electronic devices –Then used for creating Web pages with dynamic content –Now also used for: Develop.
Chapter 1: Introduction to Programs, and Java 1. Objectives To review programs (§ ). To understand the relationship between Java and the World Wide.
Introduction to Java Programming with Forte Y. Daniel Liang.
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.
National Taiwan University Department of Computer Science and Information Engineering National Taiwan University Department of Computer Science and Information.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to.
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.
JAVA Programming “When you are willing to make sacrifices for a great cause, you will never be alone.” Instructor: รัฐภูมิ เถื่อนถนอม
1 The JAVA Language Object Oriented Technology Mithani Binjan M.
Application Architecture Using Java Hong Li. Introduction Developed by a team led by James Gosling at Sun Microsystem. Originally called Oak, designed.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to.
Today… “Hello World” ritual. Brief History of Java & How Java Works. Introduction to Java class structure. But first, next slide shows Java is No. 1 programming.
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
Java Programming: Advanced Topics1 Introduction to Advanced Java Programming Chapter 1.
Lecture1 Instructor: Amal Hussain ALshardy. Introduce students to the basics of writing software programs including variables, types, arrays, control.
1 Introduction to Java. 2 * 10% Assignments/ class participation * 10% Pop Quizzes * 05% Attendance * 25% Mid Term * 50% Final Term.
20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 15: Java Basics Fundamentals of Web Programming.
Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved. 1 Chapter 1 Introduction.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to Computers,
Introduction to JAVA Programming
Introduction to 1. What is Java ? Sun Microsystems Java is a programming language and computing platform first released by Sun Microsystems in The.
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.
Fundamental of Java Programming (630002) Unit – 1 Introduction to Java.
Object Oriented Programming in
Chapter 1 Introduction to Computers, Programs, and Java
Chapter 1 Introduction to Computers, Programs, and Java
Introduction to Java.
Chapter 1 Introduction to Computers, Programs, and Java
Java History, Editions, Version Features
Introducing Java.
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:

BASIC JAVA PROGRAMMING TUTORIAL

History  James Gosling and Sun Microsystems  Oak  Java, May 20, 1995, Sun World  Hot Java –The first Java-enabled Web browser  JDK Evolutions

JDK Editions  Ja va Standard Edition (J2SE) –J2SE can be used to develop client-side standalone applications or applets.  Java Enterprise Edition (J2EE) –J2EE can be used to develop server-side applications such as Java servlets and Java Server Pages.  Java Micro Edition (J2ME). –J2ME can be used to develop applications for mobile devices such as cell phones.

Java isn't C!  In C, almost everything is in functions  In Java, almost everything is in classes  There is often only one class per file  There must be only one public class per file  The file name must be the same as the name of that public class, but with a.java extension

 It’s the current “hot” language  It’s almost entirely object-oriented programming  It has a vast library of predefined objects and operations  It’s more platform independent -this makes it great for Web programming  It’s more secure  It isn’t C++ Why Java ?

 The.class files generated by the compiler are not executable binaries –so Java combines compilation and interpretation  Instead, they contain “byte-codes” to be executed by the Java Virtual Machine –other languages have done this, e.g. UCSD Pascal  This approach provides platform independence, and greater security Java Virtual Machine

A Picture is Worth…

Java Applications and Java … lets  Stand-alone Applications –Just like any programming language  Applet –Run under a Java-Enabled Browser  Midlet –Run in a Java-Enabled Mobile Phone  Servlet –Run on a Java-Enabled Web Server.

Write Once, Run Anywhere

Main OOP Concepts :   Inheritance   Abstraction   Encapsulation   Polymorphism   Event-driven computations

Characteristics of Java  Java is simple  Java is object-oriented  Java is distributed  Java is interpreted  Java is robust  Java is secure  Java is architecture-neutral  Java is portable  Java’s performance  Java is multithreaded  Java is dynamic

What is a class ? A class consists of –a collection of fields, or variables, very much like the named fields of a struct –all the operations (called methods) that can be performed on those fields –can be instantiated A class describes objects and operations defined on those objects

Method Declarations  General format of method declaration: return-value-type method-name ( parameter1, parameter2, …, parameter N ) { declarations and statements }  Method can also return values: return expression ;

An example of a class and methods class classname { Datatypes variable; Method // returntype methodname ( ) { } }

The “Welcome to java” Application

A Simple Application Example //This application program prints Welcome //to Java public class Welcome { public static void main(String[] args) { System.out.println(“Welcome to Java"); }

Running Welcome To compile Welcome.java, use the compiler. If successful, it will produce a file called Welcome.class in the same directory. > javac Welcome.java [ compiler output ] To execute, run the Java VM and include the name of the class which contains the "main" method as the first command line parameter. > java Welcome Welcome to java

Thank You