Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Java peresentation new soft

Simple introduction to java programming

  • Login to see the comments

  • Be the first to like this

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 … 

×