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.

Fundamentals of java --- version 2

2,908 views

Published on

  • Be the first to comment

  • Be the first to like this

Fundamentals of java --- version 2

  1. 1. Fundamentals of Java Presenting overview of java Presented by Uday Sharma 1
  2. 2. Fundamentals of Java• Key Skills & Concepts • History of java • Importance of bytecode • Java Buzzword • Java development kit • IDE installation • First simple program • Second simple program • Data types • Project work • Control statement • Sample program • Project work 2
  3. 3. History of Java Get_renamed Year_1995 Oak JavaJava mainly invented for Embedded System to create softwarefor Microwave Ovens, Remote Controls and Toaster 3
  4. 4. C++ vs. Java Java easier then the C++. We can learn Java without having knowldege of C++C++ Java• Multiple Inheritance • No multiple Inheritance• Pointer • No pointer• Operator overloading • No operator overloading• Friend function • No friend function• Main method outside of class • Main method inside the class• Malloc and calloc for memory • No malloc and calloc memory management fixed 4
  5. 5. Java Bytecode• Javac command generate .class file• Interpreter generate bytecode and pass to the JVM• JVM helps to run the code on operating system 5
  6. 6. Java Buzzword 6
  7. 7. Download JAVA SDKhttp://www.oracle.com/technetwork/java/javase/downloads/index.html --- For Download Java SDKhttp://www.eclipse.org/downloads/ -- For download IDE 7
  8. 8. Set Environment Variable1. Right click on 3. Select Advanced 4. Click on EnvironmentComputer system settings variable2. Select properties 8
  9. 9. Set Environment VariableJAVA_HOME System variable 9
  10. 10. Set Environment VariableJAVA_BIN variable 10
  11. 11. Eclipse IDE• Providing environment to write multiple programming language code (E.g. Java, php, python, c, c++ and etc.)• We can easily design models (e.g. UML, XSD and etc.)• Easily integrate third pary library in our code (e.g. Facebook API, Twitter API, dropbox API and etc.)• Eclipse helps to make test driven application 11
  12. 12. Sample Java code/*This is a simple Java program.Call this file Example.java.*/class Example {// A Java program begins with a call to main().public static void main(String args[]) {System.out.println("Java drives the Web.");}} 12
  13. 13. Execute Java codeYou will follow these three steps:1. Enter the program>> CD C://path2. Compile the programC://path>> Javac helloworld.java3. Run the programC://path>> java helloworld 13
  14. 14. Data types in JavaData Type Default Value (for fields)byte 0 -- 8– bitshort 0 -- 8– bitint 0 -- 32 – bitlong 0L – 64– bitfloat 0.0f -- 32-bitdouble 0.0d – 64- bitchar u0000‘ – 16- bitString (or any object) nullboolean false – (True and false) 14
  15. 15. Arithmatic operatorArithmetic Operators• + Additive operator (also used for String concatenation)• - Subtraction operator• * Multiplication operator• / Division operator• % Remainder operator 15
  16. 16. Java Example• Addition of two integer Number• Subtraction of two integer Number• Division of two integer Number• Multiplication of two integer Number• Modulus of two integer Number 16
  17. 17. Group workDesign and build a code for simple arithmatic operationcalculator 17
  18. 18. Java comparision operatorEquality and Relational Operators• == Equal to• != Not equal to• > Greater than• >= Greater than or equal to• < Less than• <= Less than or equal toConditional Operators• && Conditional-AND• || Conditional-OR• ?: Ternary (shorthand for if-then-else statement) 18
  19. 19. References• [<Java For Beginners> <homeandlearn> http://www.homeandlearn.co.uk/java/java.html <Date><Publish>]• [<Java A Beginner’s Guide> <Herbert schildt> http://www.mhprofessional.com/downloads/product s/0071606327/01-ch01_6327.pdf <Date><McGraw- Hill> ] 19

×