Dr. Nermin Hamza.  Java applications and applets  Primitive data types  Java control flow  Methods  Object-oriented programming  Core Java classes.

Slides:



Advertisements
Similar presentations
Lecture 1 Introduction to Java Erick Pranata © Sekolah Tinggi Teknik Surabaya 1.
Advertisements

Lab Information Security Using Java (Review) Lab#0 Omaima Al-Matrafi.
Cmp Sci 187: Introduction to Java Based on Appendix A of text (Koffmann and Wolfgang)
Advanced Programming Rabie A. Ramadan vpro/ Lecture 1.
Lab#1 (14/3/1431h) Introduction To java programming cs425
Liang, Introduction to Java Programming, Sixth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to.
Introduction to Java Kiyeol Ryu Java Programming Language.
1 Fall 2008ACS-1903 Chapter 1 Topics Java History Java Programs Why Program? Computer Systems: Hardware and Software Programming Languages What Is a Program.
Introduction to Java Programming, 4E
For more Lectures and Notes Visit
Review Java.
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.
Java Programming Language Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University
Advanced OOP MCS-3 OOP BSCS-3 Lecture # 1
BASIC JAVA PROGRAMMING TUTORIAL. History  James Gosling and Sun Microsystems  Oak  Java, May 20, 1995, Sun World  Hot Java –The first Java-enabled.
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.
Introduction to Java Appendix A. Appendix A: Introduction to Java2 Chapter Objectives To understand the essentials of object-oriented programming in Java.
CSCI 224 Introduction to Java Programming. Course Objectives  Learn the Java programming language: Syntax, Idioms Patterns, Styles  Become comfortable.
Advanced Java New York University School of Continuing and Professional Studies.
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.
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,
Java Introduction Lecture 1. Java Powerful, object-oriented language Free SDK and many resources at
Introduction to Java CSIS 3701: Advanced Object Oriented Programming.
J2ME Presented by May Sayed & Menna Hawash. Outline Introduction “Java Technology” Introduction “What is J2ME?” J2ME Architecture J2ME Core Concepts 
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 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.
© 2012 Pearson Education, Inc. All rights reserved. 1-1 Why Java? Needed program portability – Program written in a language that would run on various.
Introduction to Java Programming with Forte Y. Daniel Liang.
Introduction to Java Programming. Introduction Course Objectives Organization of the Book.
Session 1 Introduction to Java. Objectives Java Simplified / Session 1 / 2 of 32 Explain the history of Java Explain Java in brief List the types of Java.
National Taiwan University Department of Computer Science and Information Engineering National Taiwan University Department of Computer Science and Information.
 Programming Language  Object Oriented Programming  JAVA – An Introduction  JAVA Milestones  JAVA Features.
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.
Java – in context Main Features From Sun Microsystems ‘White Paper’
©2016 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. CSC 110 – INTRO TO COMPUTING - PROGRAMMING Overview of Programming.
Spring 2009 Programming Fundamentals I Java Programming XuanTung Hoang Lecture No. 8.
1 Introduction to Java. 2 * 10% Assignments/ class participation * 10% Pop Quizzes * 05% Attendance * 25% Mid Term * 50% Final Term.
Java Computer Industry Lab. 1 Programming Java Java Basics Incheon Paik.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to Computers,
Introduction to JAVA Programming
JAVA TRAINING IN NOIDA. JAVA Java is a general-purpose computer programming language that is concurrent, class-based, object-oriented and specifically.
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.
 It is a pure oops language and a high level language.  It was developed at sun microsystems by James Gosling.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Fundamental of Java Programming (630002) Unit – 1 Introduction to Java.
Object Oriented Programming in
JAVA MULTIPLE CHOICE QUESTION.
Chapter 1 Introduction to Computers, Programs, and Java
Chapter No. : 1 Introduction to Java.
Introduction Enosis Learning.
Introduction Enosis Learning.
Advanced Programming Fall 2017.
Introduction to Data Structure
(Computer fundamental Lab)
Java History, Editions, Version Features
Introducing Java.
Introduction to Java By Prakash G Asnani
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:

Dr. Nermin Hamza

 Java applications and applets  Primitive data types  Java control flow  Methods  Object-oriented programming  Core Java classes (Swing, exception,, multithreading,, I/O, networking)

 You will be able to  Write applications and applets  Develop a GUI interface  Write interesting projects  Establish a firm foundation on Java concepts

 Book 1- “Introduction to java programming” 7 th edition, Y. Daniel Liang 2- “Java How To Program” 8 th edition, Paul Deitel, Harvey Deitel  Lecture Notes

Midterm exam1517  2 bounce quizor sheet53x2  1 bounce Lab assignment102x Total  3 bounce

 Part I: Fundamentals of Programming  Introduction to Java  Primitive Data Types and Operations  Control Statements  Methods

 Part II: Object-Oriented Programming  Programming with Objects and Classes  Class Inheritance  Arrays and Vectors

 Part III: Graphics Programming  Creating User Interfaces  Applets and Advanced Graphics

 Part IV: Developing Comprehensive Projects  Exception Handling  Internationalization  Multithreading  Input and Output  Networking  Data Base with java

Part I: Fundamentals of Programming

 Part I: Fundamentals of Programming  Introduction to Java  Primitive Data Types and Operations  Control Statements  Methods

 New and Effective OOP language  Run-time Environment (tools, class library, documentation)  Compiled for speed  Interpreted  Portable (architectural-neutral via JVM)  Directly supported by major OS’s  Apple, Linux, HP, Hitachi, IBM, Windows, Novell, Silicon Graphics, Sun, Tandem

 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

 Web-based applications  common interface to applications/data inside and outside company  Portability  even for non-web-based applications  applications will run on all major platforms  Distributed Applications  RMI is easier and less expensive than CORBA but lacks services  Networking  supports TCP and UDP sockets  can access remote data using a variety of protocols

 Multithreading  can utilize multiple processors  more natural style of coding for some applications  Object-oriented  encourages better software design  easier to maintain, extend and reuse  Garbage collection  software is less prone to errors  Productivity  fewer source files need to be compiled when changes are made  eliminates time to repeatedly link executables during development

 1991 The Green Project Begins MS DOS is the dominant operating system Cell phones weigh half a pound "Biosphere 2" project begins Oak  1995 Java technology released to a select group on the Web site wicked.neato.org The San Jose Mercury News runs a front-page article about Java technology Name changed from "Oak" to "Java“ Announced at Sun World -- Java technology is officially born

 1996 The first Java One Developer Conference JDK tm 1.0 software is released  1998 JDK 1.1 release downloads top 2 million Visa launches world's first smart card based on Java Card technology

 1999 Java 2 platform source code is released Java One draws 20,000 J2EE beta software is released  2001 First international Java One conference in Yokohama Japan Over 1 million downloads of the Java Platform, Enterprise Edition (Java EE) SDK Google Inc.

 2007 Sun released the source code of the Class library under GPL on May 8, 2007 Java technology is in more than 5.5 billion devices and is used by more than six million developers. The iPhone is released  2010 Oracle acquires Sun Microsystems. The JCP approves Java 7 and Java 8 roadmaps. Java One 2010 is held concurrently with Oracle Open World in September.

 JDK The Java Development Kit (JDK) is a Sun Microsystems product aimed at Java developers.  JRE Java Runtime Environment, The combination of the Java Virtual Machine, the core class library and supporting files, all of which are required to run a Java program  JFC ( J ava F oundation C lasses) A class library from Sun that provides an application framework and graphical user interface (GUI) routines for Java programmers.

 Java SEStandard Edition  Java Platform, Standard Edition (Java SE) lets you develop and deploy Java applications on desk top sand servers, as well as in today's demanding embedded environments.  Java offers the rich user interface, performance, versatility, portability, and security that today’s applications require

 Java EE Java Platform, Enterprise Edition (Java EE)  Java Platform, Enterprise Edition (Java EE) is the industry standard for enterprise Java computing.  Developers will benefit from productivity improvements with more annotations, simplified packaging, and less XML configuration

 Java ME, Micro Edition (Java ME)  Java Platform, Micro Edition (Java ME) provides a robust, flexible environment for applications running on mobile and other embedded devices: mobile phones, personal digital assistants (PDAs), TV set-top boxes, and printers.

 Java 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 ServerPages.  Java Micro Edition (J2ME).  J2ME can be used to develop applications for mobile devices such as cell phones. 26

 Borland JBuilder  Net Beans Open Source by Sun  Sun ONE Studio by Sun Micro Systems  Eclipse Open Source by IBM  And so on… 27

 An Abstract Data Type ( ADT ) is a user-defined data type that satisfies the following two conditions: ( Encapsulation + Information Hiding )  The representation of, and operations on, objects of the type are defined in a single syntactic unit; also, other program units can create objects of the type.  The representation of objects of the type is hidden from the program units that use these objects, so the only operations (methods) possible are those provided in the type's definition which are known as interfaces. ADT --- Data Abstraction

Appendix A: Introduction to Java30  Java distinguishes two kinds of entities  Primitive types  Objects  Primitive-type data is stored in primitive-type variables  Reference variables store the address of an object  No notion of “object (physically) in the stack”  No notion of “object (physically) within an object”

Appendix A: Introduction to Java31  Represent numbers, characters, boolean values  Integers: byte, short, int, and long  Real numbers: float and double  Characters: char

Appendix A: Introduction to Java32 Data typeRange of values byte (8 bits) short -32, ,767 (16 bits) int -2,147,483, ,147,483,647 (32 bits) long -9,223,372,036,854,775, (64 bits) float +/ to +/ and 0, about 6 digits precision double +/ to +/ and 0, about 15 digits precision char Unicode characters (generally 16 bits per char) boolean True or false

Appendix A: Introduction to Java33 1. subscript [ ], call ( ), member access. 2. pre/post-increment ++ --, boolean complement !, bitwise complement ~, unary + -, type cast (type), object creation new 3. * / % 4. binary + - ( + also concatenates strings) 5. signed shift >, unsigned shift >>> 6. comparison >=, class test instanceof 7. equality comparison == != 8. bitwise and & 9. bitwise or |

Appendix A: Introduction to Java logical (sequential) and && 12. logical (sequential) or || 13. conditional cond ? true-expr : false- expr 14. assignment =, compound assignment += -= *= /= >= >>>= &= |=

Appendix A: Introduction to Java35  Widening conversion:  In operations on mixed-type operands, the numeric type of the smaller range is converted to the numeric type of the larger range  In an assignment, a numeric type of smaller range can be assigned to a numeric type of larger range  byte to short to int to long  int kind to float to double

Appendix A: Introduction to Java36  int square; square = n * n;  double cube = n * (double)square;  Can generally declare local variables where they are initialized  All variables get a safe initial value anyway (zero/null)

Appendix A: Introduction to Java37  You can declare reference variables  They reference objects of specified types  Two reference variables can reference the same object  The new operator creates an instance of a class  A constructor executes when a new object is created  Example: String greeting = ″hello″;

Appendix A: Introduction to Java38  A group of statements executed in order is written  { stmt1; stmt2;...; stmtN; }  The statements execute in the order 1, 2,..., N  Control statements alter this sequential flow of execution

Appendix A: Introduction to Java39

Appendix A: Introduction to Java40

Appendix A: Introduction to Java41  A Java method defines a group of statements as performing a particular operation  static indicates a static or class method  A method that is not static is an instance method  All method arguments are call-by-value  Primitive type: value is passed to the method  Method may modify local copy but will not affect caller’s value  Object reference: address of object is passed  Change to reference variable does not affect caller  But operations can affect the object, visible to caller

Appendix A: Introduction to Java42

Appendix A: Introduction to Java43  An escape sequence is a sequence of two characters beginning with the character \  A way to represents special characters/symbols

Appendix A: Introduction to Java44  The String class defines a data type that is used to store a sequence of characters  You cannot modify a String object  If you attempt to do so, Java will create a new object that contains the modified character sequence