Your SlideShare is downloading. ×
00 intro to java
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

00 intro to java

550

Published on

Published in: Technology, Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
550
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
23
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Engr. Dheya Abdullah JAVA Overview
  • 2. What will this talk cover?
    • Outline
      • Brief History
      • How Java Work
      • Java Virtual Machine JVM
      • JVM Architecture
      • OOP Concepts
      • Java features
      • Java Libraries
      • What is Java good for
      • Hello world program in Java
      • Java Applet
  • 3. What is Java?
    • History
      • Started in (1991) as a small language for consumer electronics (toasters, microwave ovens… etc. ) by James Gosling with the name of OAK.
      • Java is developed by Sun Microsystems and officially released in 1995.
      • The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities.
  • 4. How does Java work?
    • Java source code is compiled into machine independent “bytecodes”
    • The bytecodes can be run directly by an interpreter
    • The bytecodes can be converted to machine code and executed (“ Just in Time (JIT)” compilation).
    • An optimizing interpreter can dynamically identify program “hotspots” and create code optimized for the specific machine/environment.
  • 5. Java Virtual Machine JVM
    • its just a program that runs in the host computer. It receives bytecodes and gives machine-code understandable to the host computer
    • So its evident that we have a single Compiler but multiple JVMs (JVM for Windows, JVM for Unix, JVM for MacOS).
    • Any new system that will appear in future, java will make a new JVM for it so java supports unknown future machines.
  • 6. JVM Architecture
    • Class Loader : loads the java programs (bytecodes)
    • Bytecodes verifier : verifies that bytecode has not been modified since it last compilation.
    • Interpreter : this is the actual part that translates the bytecode into a code understandable/executable by the host machine.
    • Other parts not shown in this figure are
    • Security manager
    • Library classes
    • JIT (Just in time compiler)
  • 7. Main OOP Concepts
    • OOP is a set of concepts for organizing and arranging the code in a program its not a programming language.
    • Main concepts of OOP:
      • Class ( a structure that contains variables and functions together )
      • Object (an instance of a class)
      • Encapsulation.
      • Inheritance.
      • Polymorphism.
    • Coming lectures will make these concepts more clear.
  • 8. Java Features
    • Simple
      • Java in similar to C++ in its syntax, but it is simpler than C++ in developing applications because its rich in its libraries (Java has a huge amount of ready made functions so programmer doesn't need to rewrite them)
    • Object Orientated
      • Java implements OOP concepts more so than C++.
      • In C++ programmer has the option to go for Procedural way of programming or to Object Oriented way of programming its optional.
      • But in Java its purely OOP programmer have to follow OOP concepts to develop applications in Java no other option.
    • Distributed
      • Distributed systems is an environment where single application can run on multiple computers connected in a network.
      • Java supports Internet protocols, URL’s, HTTP etc.
      • Support for distributed objects, RMI, CORBA etc.
    • Robust
      • Difficult to create memory leaks, go beyond the end of an array.
  • 9. Java Features Cont.
    • Secure
      • Bytecodes “verifier”, checks the program before it is executed.
    • Platform independent / Portable
      • JVM accepts only bytecodes and generates host’s machine-code.
    • Interpreter / Compiler
      • Java default Translator is an interpreter.
      • Java also has a compiler known as JIT Just In Time compiler.
    • High Performance
      • With JIT compiler still several times slower than native C++. But with Sun Optimizing Interpreter, java programs can run faster than C++ program.
    • Multithreaded
      • Java has direct support for multithreading (c.f. subprocesses)
    • Dynamic
      • Libraries can change without recompiling programs that use them.
  • 10. Java Libraries (API’s)
    • In addition to the core language, java has additional classes:
      • AWT - Basic GUI (Forms, Buttons, Textbox, Dropdown-box, Radio/Check)
      • SWING - Enhanced GUI toolkit
      • 2D – Drawings (lines, shapes such as circle, square…etc ), Transformations, pattern fill, textures etc.
      • JDBC - Standard Interface between Java and SQL databases
      • ODMG binding - Standard Interface to Object databases
      • RMI + CORBA - Remote procedure calls between distributed Java applications, and between Java and other languages
      • BEANS - Java based components, plug commercial components into your applications.
      • Media (audio, video etc.), Share (e.g. whiteboards), Animation , Telephony , 3D (developed by SUN and SGI), cryptography , server .
  • 11. What is Java Good For?
    • Stand Alone Applications
      • GUI based applications
    • Database programming
      • SQL databases using JDBC
      • Object databases using ODMG binding
    • Web Applets
    • Java Servlets
    • Distributed client-server applications
      • Using TCPIP + RMI + CORBA
    • Graphics applications
      • 2D and 3D
  • 12. Java Program Types
    • Java can make two type of program
      • Application (a full standalone program such C++ language programs that can run on any OS).
      • Applets (a light weight program that runs within Internet Browsers its usually a part of web pages)
  • 13. Hello World in Java
    • This is how Java Application looks like
  • 14. Java Applets
    • Java Applets : are programs designed to run inside a web browser.
    • Applets loaded from the internet are run inside a “sandbox” which restricts what they can do:
      • No Access to local filesystem
      • Can only open network connections with the site they came from
    • Problems (the need for applet)
      • Complex programs can be large and hence slow to download
      • Each browser has subtle differences.
  • 15. Assignment #1
    • Objective : This Assignment will help students to compare two languages to understand common concepts and unique features of each language.
    • You can compare any two languages, choose one of these titles and work on it.
      • Java vs. VB.Net
      • Java vs. C++
    • The comparison should contain at least six differences with three lines explanation of each difference.
    • Submission Timing:
    • the assignment should be submitted after one complete week (2 nd lecture next week).
    • These assignments are Marked assignment.
    • The Solution will look like
    Hint: use Google.com to get the material and then summarize it in your words Java C++ Pure OOP language: Java is pure OOP language because it allow programmer to write code only in classes and objects. Hybrid language: C++ allows programmer to write code in structural way using functions or OOP way using classes and objects (OOP is optional). … .. …… ..
  • 16. Evaluation, Rules & Instructions:
    • Evaluation :
      • Final exam will be taken at end of semester with 35% weight.
      • Mid semester exam will be taken at 6th week with 20% weight.
      • Assignments, Class interaction, Lab performance and attendance 15% weight.
      • Announced short Quizzes will be taken with 10% weight.
      • Semester Project with 20% weight.
    •   Road map to pass JAVA course:
      • Attend Classes regularly and Do lab work .
      • Submit mini assignments.
      • Don’t miss quizzes.
      • Attend mid-exam and final exam.
    • Rules & Instructions:
      • End of each week (2 nd lecture of the week) a marked assignment will be given and it will be collected next week 1 st lecture.
      • First lecture of the next week a short quiz will be taken from last week topics and assignment.
  • 17. More Information
    • Web Sites
      • http://www.javasoft.com
        • Sun’s home page for Java
      • http://www.javasoft.com/books/Series/Tutorial/index.html
      • http://www.gamelan.com/
        • Huge library of Java applets and applications
      • http://www.javaworld.com
      • http://www.javareport.com
        • JavaWorld/Java Report (magazines)
      • http://www.microsoft.com/visualj
        • Visual J++
    • Books
    • Text Book:
    • Java Software Soultions
    • Foundations of program design 6 th edition, Lewis & Loftus, Pearson.
    • Reference Book:
    • John Zukowski, Mastering Java 2 , Sybex.
  • 18. Conclusion
    • If you are still using:
      • Fortran, C, C++, Perl, CGI, SQLPlus, Rexx, IDA etc.
    • you could save yourself a lot of time and effort by switching to:

×