Java peresentation new soft

359 views

Published on

Simple introduction to java programming

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
359
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
10
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Java peresentation new soft

  1. 1. JAVA Programming Language Mohamed Refaat
  2. 2. Historical View  Sun formally announced Java at an industry conference in May 1995.  Java is now used to develop large-scale enterprise applications.
  3. 3. Java Class Libraries  Java programs consist of pieces called classes.  Classes include pieces called methods and Object that perform tasks.
  4. 4. JAVA Characteristic  Object-oriented.  Portable - platform independent.  Simpler development - strong and static typing.  Familiar - took the best out of C++.
  5. 5. JVM – Java Virtual Machine  JVM is an interpreter that translates Java bytecode into real machine language instructions.  Compiled once run on any machine that has a JVM.
  6. 6. JVM – Java Virtual Machine Java SDK (Software Development Kit). JRE (Java Runtime Environment). JDK (Java Development Kit).
  7. 7. JVM – Java Virtual Machine
  8. 8. IDE – Integrated Development Environment  Oracle JDeveloper.  Eclipse.  NetBeans. And More…
  9. 9. How To Work…  Download Java JDK from this Link.  Install JDK.  Use one of the Previous editor (IED) for develop.
  10. 10. Hello World…package HelloWorld; public class HelloWorld { public HelloWorld() {} // Constructor public HelloWorld(String s) { System.out.println(s); } public static void main(String[] args) { // TODO Auto-generated method stub System.out.println("I'm JAVA Programmer..."); } }
  11. 11. Main Method  Like C ,C++ and C#, Java applications must define a main() method in order to be run.
  12. 12. Primitive Types
  13. 13. Flow Control
  14. 14. For each  For each input [i] in iterator a do int [] a = new int[10]; for(int i : a) { System.out.println(i); }
  15. 15. Using Packages import HelloWorld.*; …  HelloWorld hw=new HelloWorld();
  16. 16. Visibility of Members  public  Can be accessed from outside the package.  protected  Can be accessed from derived classes  private  Can be accessed only from the current class  default ( if no access modifier is stated )  Can be called within the same package.
  17. 17. The Object Class  Root of the class hierarchy.  Any Class extends Object Class.  boolean equals(Object o) // check equality  String toString() // called when print the class out Put Class name  EX: System.out.println(hw);  Has many other uses class  EX: Math,
  18. 18. Equality Test  EX: String Example HelloWorld hw1 = new HelloWorld (); HelloWorld hw2 = new HelloWorld (); if (hw1 == hw2){ System.out.println("hw1 == hw2"); }
  19. 19. Generic  Define generic object.  Can use the same object with deferent type. ArrayList<String> arrList = new ArrayList<String>(); ArrayList<Integer> arrList = new ArrayList<Integer>();
  20. 20. Collections  Set :  A collection that does not contain duplicates.  List :  An ordered collection that can contain duplicate elements.  ArrayList.  Map :  Associates keys to values and cannot contain duplicate keys.  Queue :
  21. 21. Resources  JAVA Tutorial  http://docs.oracle.com/javase/tutorial/  JAVA Documentation  http://docs.oracle.com/javase/6/docs/api/  JAVA Book  Java How to Program 7th Edition (2007)  You can find this presentation and SMS Project on this link  https://docs.google.com/open?id=0BwXvifbsCL2iSmstRE d1UHZ3N3M
  22. 22. Thanks … 

×