Introduction To Java.


Published on

In This Presentation You See a brief history of java and all major topic like packege,util class and More.

1 Comment
No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Ahora vamos a hablar acerca de las diferentes plataformas Java existentes que permiten desarrollar aplicaciones en una aplica gama de dispositivos y contextos. Java Card es el plataforma que permite desarrollar software para dispositivos pequeños que utilizan tarjetas inteligentes y software empotrado como lectoras de código de barras o lectoras de tarjetas de créditos. Esta plataforma es más utilizada por los fabricantes de estos dispositivos. Con la versión 1.2, Java se separó en tres plataformas: J2SE (ahora Java SE), J2EE (ahora Java EE) y J2ME (ahora Java ME). La primera de ellas conserva el núcleo original del lenguaje y sus APIs y está pensada para el desarrollo de aplicaciones de escritorio y applets. Cubre muchas funcionalidades como soporte de GUI con Swing y AWT, I/O, multithreading, etc. Java EE es la plataforma para desarrollo de aplicaciones Web empresariales y grandes sistemas distribuidos. Ser encarga de la interacción entre servidores de aplicaciones y de bases de datos, persistencia de datos, seguridad, etc. Java ME es la plataforma que permite que nosotros podamos escribir aplicaciones para nuestros propios celulares, PDAs y PocketPCs. Java ME utiliza solo una parte de las APIs de Java SE y suministra sus propias bibliotecas de soporte. Por último tenemos a Java FX, la plataforma más reciente de Java y que pretende competir con Adobe y Flash y con Microsoft y Silverlight en el desarrollo de aplicaciones RIA (Rich Internet Applications). Estas aplicaciones se caracterizan por ejecutarse en los navegadores y tener una interfaz gráfica muy rica en cuanto a gráficos e interacción con el usuario. Java FX introduce su propio lenguaje script.
  • En este gráfico podemos apreciar como se distribuye el soporte de los diferentes dispositivos existentes entre las 3 plataformas principales de Java. Podemos apreciar que existen múltiples tipos de máquinas virtuales, como la CVM, KVM y la JVM.
  • In order to land high paying jobs, students need to find ways to differentiate themselves from other recent graduates. Through the Sun Academic Initiative, Sun offers free training that will help you fast-track your career. As an example, a recent article in CIO Magazine included the Sun Certified Programmer for Java 2 platform and the Sun Certified Systems Administrator for Solaris as two of the hot certifications that are able to demand higher wages. Refer to the hand-out with instructions for online registration and certification exams.
  • Introduction To Java.

    1. 1. Introduction to Java Tushar Chauhan Osum Leader C.U.Shah College Of Engineering & Technology, Wadhwan City
    2. 2. Agenda <ul><li>What is Java?
    3. 3. A little bit of history
    4. 4. Java performance
    5. 5. Java sintax
    6. 6. Java packages
    7. 7. Java applications
    8. 8. Demo
    9. 9. Where and how to learn Java </li></ul>
    10. 10. What is Java???
    11. 11. An exotic island...? Friendly people, spicy food, beautiful beaches
    12. 12. An IT Brand?
    13. 13. What is Java? <ul><li>An object oriented programming language developed in the early '90s.
    14. 14. The language itself takes much of its syntax from C and C + + but has a simpler object model and eliminates low-level tools.
    15. 15. It is platform independent. Early implementations of Java had the slogan: &quot;write once, run anywhere&quot;
    16. 16. It has a system of automatic memory management. </li></ul>
    17. 17. A programming language
    18. 18. A platform
    19. 19. And where is Java? Java is everywhere...
    20. 20. Where is Java? It's here...
    21. 21. Where is Java? And here...
    22. 22. Where is Java? And here...
    23. 23. A little bit of history
    24. 24. A little bit of history <ul><li>It was conducted by a team of 13 people, led by James Gosling.
    25. 25. Gosling's goals were to implement a virtual machine and a language with a structure and syntax similar to C + +. </li></ul><ul><li>Java was originally created as a programming tool for a project set-top box known as * 7. </li></ul>
    26. 26. A little bit of history (II) <ul><li>The language was originally called &quot;Oak&quot;. Later renamed &quot;Green&quot; after discovering that Oak was already a trademark.
    27. 27. The term &quot;Java&quot; was coined in a coffee store frequented by members of the team.
    28. 28. It is unclear if it is an acronym or not, some hypotheses suggest that it could be the initials of its creators: J ames Gosling, A rthur V an Hoff, and A ndy Bechtolsheim. Other advocates of &quot; J ust A nother V ague A cronym.
    29. 29. The most accepted hypothesis is that Java is named after a type of coffee available in the coffee store. </li></ul>
    30. 30. Java Architecture
    31. 31. .java, .class, JVM??? <ul><li>In Java, source code is written in a plain text file with a .Java extension
    32. 32. Then, the code is compiled into a .Class file. A .Class does not contain native code for a type of processor, instead it contains bytecodes.
    33. 33. Finally, the application is interpreted by the Java virtual machine, transforming the bytecode to native code at runtime. </li></ul>
    34. 34. Bytecode <ul><li>The bytecode is the native language of any implementation of Java Virtual Machine. In this way, a Java program runs on any platform with a JVM. </li></ul>
    35. 35. Java platform Java Card Java SE Java EE Java ME Java FX
    36. 36. Java platform D:My PresentationUnijoyo Java Presentationimgjava platform.gif
    37. 37. Java Language <ul><li>Object oriented
    38. 38. Distributed
    39. 39. Simple
    40. 40. Multithread
    41. 41. Safe
    42. 42. Platform independent </li></ul>
    43. 43. Some concepts... <ul><li>Distributed: Java is distributed because it offers support for distributed network technologies such as RMI (remote method invocation), CORBA (common object request broker architecture) and URI (universal resource locator)
    44. 44. Simple: No pointers, no garbage collector
    45. 45. Multithreading
    46. 46. Safe: restrictions on access to devices directly (pointers) </li></ul>
    47. 47. Java syntax
    48. 48. Java syntax in detail Variable initialization <ul><li>The Java language is strongly typed, which means that all variables must be declared before use. </li></ul>int unaVariable = 1;
    49. 49. String Class <ul><li>Java provides special support for the strings via the java.lang.String class
    50. 50. It is not a primitive type.
    51. 51. However, by overloading operators you can perform operations such as: </li></ul>String unString = “Juan” + “ ” + “Perez” ; <ul><li>Java also provides a wide range of operations to manipulate instances of this class. </li></ul>
    52. 52. Example with arithmetic operators int i=2+3; // i equals 5 i=i+1; //i equals 6 i=6*2; //i equals 12 i=2+5*2%8; //i equals 4
    53. 53. Example with posfix and unary operators int i=5; // i equals 5 System.out.println(i); //print:5 System.out.println(++i); //print:6 System.out.println(i++); //print:6 System.out.println(i); //print:7
    54. 54. Control sentences: if if(expr){ .... } if(expr) sentencia; if(expr){ .... } else { .... }
    55. 55. Control sentences: switch Switch (num){ case num1:...break; case num2:...break; default:...break; }
    56. 56. Control sentences: while and do-while while (expr){ .... } do { .... }while(expr);
    57. 57. Control sentences: for for (exprInic; stopCond; nextStep){ .... } for (int i=0; i<10; i++) { System.out.println(i); } //print numbers from 0 to 9
    58. 58. Java Packages
    59. 59. Java program structure <ul><li>The object-oriented programming structure is that each program is a simulation of a real or virtual world.
    60. 60. Each of these worlds are composed of objects .
    61. 61. Objects communicate through messages.
    62. 62. Therefore, an object-oriented program is nothing more than a configuration of a set of objects and messages sent between them.
    63. 63. The &quot;box&quot; that holds the description of all objects of the same type is what is known as a class.
    64. 64. In turn, the classes with similar purposes can be grouped into packages.
    65. 65. The program execution begins at the &quot;main&quot; method of a class. </li></ul>
    66. 66. Package example
    67. 67. Rules for creating classes and packages <ul><li>Java classes are deployed in separate files.
    68. 68. Each class must be found within a package.
    69. 69. The file name of implementing class must match the name of the class.
    70. 70. The package structure should match the directory structure. Eg: edu.sun.Ejemplo would be mapped to the file ... / edu / sun / </li></ul>
    71. 71. Class structure Package person; Import java.util.Vector; public class Person { private Vector partners ; public Person() { this . partners = new Vector(); } public Person(Vector friends) { this . partners = friends; } public void addPartners(Person aPerson){ this . partners .add(aPerson); } }
    72. 72. Java packages examples <ul><li> </li><ul><li>The packet input / output contains the file access classes: FileInputStream and FileOutputStream, and so on. </li></ul></ul><ul><li>java.lang </li><ul><li>Includes Java classes themselves: Object, Thread, Exception, System, Integer, Float, Math, String, etc.. </li></ul><li>java.util </li><ul><li>Miscellaneous useful classes for many things in programming.
    73. 73. It includes, Date (date), Dictionary (dictionary), Random (random numbers) and Stack (stack FIFO). </li></ul></ul>
    74. 74. java.lang <ul><li>Primitive types are encapsulated in classes: </li><ul><li>Boolean
    75. 75. Byte
    76. 76. Character
    77. 77. Double
    78. 78. Float
    79. 79. Integer
    80. 80. Long
    81. 81. Short
    82. 82. Void </li></ul></ul>
    83. 83. java.lang (II) <ul><li>Example: Integer (public interface): </li><ul><li>public final class Integer extends Number
    84. 84. Variables: </li><ul><li>MAX_VALUE (max value for an “int”)
    85. 85. MIN_VALUE (min value for an “int”) </li></ul><li>Builders: </li><ul><li>Integer(int)
    86. 86. Integer(String) </li></ul><li>Methods: </li><ul><li>Conversion to other types: doubleValue(), floatValue(), intValue(), parseInt(String), toString(), valueOf(String)
    87. 87. Getting a value as an “int”: intValue() </li></ul></ul></ul>
    88. 88. java.lang (III) <ul><li>Clases for char characters: </li><ul><li>clase String: set of characters non editable
    89. 89. clase StringBuffer: set of editable characters </li></ul></ul><ul><li>public final class String extends Object implements Serializable </li></ul>
    90. 90. java.lang (IV) <ul><li>Builders: </li><ul><li>String(byte[])
    91. 91. String(char[])
    92. 92. String(String) </li></ul></ul><ul><li>examples: </li></ul>char[] chars = {’a’,’b’,’c’}; String s = new String(chars); String s1 = “Hello”; String s2 = new String(s1);
    93. 93. java.lang (V) <ul><li>Manipulation string methods: </li><ul><li>length() , concat(String), indexOf(String), lastIndexOf(String) , toUpperCase(), ... </li></ul></ul><ul><li>Conversion from other types methods: </li><ul><li>valueOf(double), valueOf(int), ... </li></ul></ul><ul><li>Operator “+” in string is overloaded: </li><ul><li>3+”abc”+3.4 </li></ul></ul>
    94. 94. java.lang (VI) <ul><li>Class Math </li></ul><ul><li>Constants: </li><ul><li>E, PI </li></ul></ul><ul><li>Methods: </li><ul><li>abs(double), acos(double), asin(double), atan, cos, exp, log, max(double, double), pow(double, double), round (float) </li></ul></ul>
    95. 95. java.lang (VII) <ul><li>Class System </li><ul><li>Variables (static): </li><ul><li>in: &quot;standard” input stream. Usually is the keyboard
    96. 96. out: &quot;standard” output stream. Usually, is the message window
    97. 97. err: &quot;standard&quot; error output stream. Usually is the message window </li></ul></ul><li>Methods: </li><ul><li>getProperties(), gc() - force to use the memory administrator </li></ul></ul>
    98. 98. Other packages <ul><li>Package java.util </li><ul><li>Classes: Vector, Date, HashMap, StringTokenizer… </li></ul></ul><ul><li>Package java.text </li><ul><li>Classes: DateFormat, DecimalFormat… (formatting methods). </li></ul></ul><ul><li>Package java.math </li><ul><li>Classes: BigDecimal, BigInteger… (precision issues and more). </li></ul></ul>
    99. 99. Java Development Kit (JDK) <ul><li>El JDK consists of the following: </li><ul><li>The Java development tools, including the compiler, debugger and the Java interpeter.
    100. 100. The Java class libraries organized as a collection of packages.
    101. 101. A significant number of demonstration programs.
    102. 102. Various support tools and components, including source code of classes in the library. </li></ul><li>URL : </li></ul>
    103. 103. <ul><li>The NetBeans IDE is a development environment created based on open source platform from homonymous
    104. 104. Develop network-enabled Java Beans components.
    105. 105. Jarda Tulach, who designed the IDE's basic architecture, came up with the name NetBeans to describe what they would do </li><ul><li>Network + Java Beans = NetBeans </li></ul><li>It is multiplatform
    106. 106. CDDL and GPL 2 License.
    107. 107. </li></ul>
    108. 108. Learning resources for Java <ul><li>Sun's Java Tutorials </li><ul><li> </li></ul></ul><ul><li>Sun Academic Iniciative </li><ul><li>
    109. 109. </li></ul></ul><ul><li>Java Passion </li><ul><li> </li></ul></ul>
    110. 110. Questions
    111. 111. Next Steps <ul><li>Visit Osum project repository for more Java tech demos using NetBeans
    112. 112. Join Java groups inside osum and participate in the communities
    113. 113. Build your own Java programs </li></ul>
    114. 114. Next Steps <ul><li>Get FREE Web-based training on Java TM , Solaris TM & more! </li><ul><li>Visit:
    115. 115. Course registration code for ABC University is XYZ </li></ul><li>Increase earnings potential with a Sun Certification! </li><ul><li>Sun Certified Associate/Programmer for the Java 2 Platform SE
    116. 116. Sun Certified Web Component Developer for Java EE
    117. 117. Sun Certified Mobile Application Developer for Java ME
    118. 118. Sun Certified System/Network Admin for Solaris Operating System </li></ul><li>Free practice exams
    119. 119. Discounted exams fees for academic developers – only US$40 worldwide </li></ul>Fast Track Your Career with Sun!
    120. 120. Introduction to Java Tushar Chauhan [email_address] CCET, Wadhwan City.