Download presentation
Presentation is loading. Please wait.
Published byJulius Potter Modified over 8 years ago
1
Dr. Nermin Hamza
2
Java applications and applets Primitive data types Java control flow Methods Object-oriented programming Core Java classes (Swing, exception,, multithreading,, I/O, networking)
3
You will be able to Write applications and applets Develop a GUI interface Write interesting projects Establish a firm foundation on Java concepts
4
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
5
Midterm exam1517 2 bounce quizor sheet53x2 1 bounce Lab assignment102x5 ------------------------------------------------------------------- Total 30 33 3 bounce
6
Part I: Fundamentals of Programming Introduction to Java Primitive Data Types and Operations Control Statements Methods
7
Part II: Object-Oriented Programming Programming with Objects and Classes Class Inheritance Arrays and Vectors
8
Part III: Graphics Programming Creating User Interfaces Applets and Advanced Graphics
9
Part IV: Developing Comprehensive Projects Exception Handling Internationalization Multithreading Input and Output Networking Data Base with java
10
Part I: Fundamentals of Programming
11
Part I: Fundamentals of Programming Introduction to Java Primitive Data Types and Operations Control Statements Methods
12
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
13
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
16
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
17
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
18
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
19
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
20
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.
21
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.
22
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.
23
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
24
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
25
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.
26
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
27
Borland JBuilder Net Beans Open Source by Sun Sun ONE Studio by Sun Micro Systems Eclipse Open Source by IBM And so on… 27
29
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
30
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”
31
Appendix A: Introduction to Java31 Represent numbers, characters, boolean values Integers: byte, short, int, and long Real numbers: float and double Characters: char
32
Appendix A: Introduction to Java32 Data typeRange of values byte -128.. 127 (8 bits) short -32,768.. 32,767 (16 bits) int -2,147,483,648.. 2,147,483,647 (32 bits) long -9,223,372,036,854,775,808..... (64 bits) float +/-10 -38 to +/-10 +38 and 0, about 6 digits precision double +/-10 -308 to +/-10 +308 and 0, about 15 digits precision char Unicode characters (generally 16 bits per char) boolean True or false
33
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 |
34
Appendix A: Introduction to Java34 11. logical (sequential) and && 12. logical (sequential) or || 13. conditional cond ? true-expr : false- expr 14. assignment =, compound assignment += -= *= /= >= >>>= &= |=
35
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
36
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)
37
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″;
38
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
39
Appendix A: Introduction to Java39
40
Appendix A: Introduction to Java40
41
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
42
Appendix A: Introduction to Java42
43
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
44
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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.