500 likes | 1.49k Views
This Edureka Java Training tutorial will help you in understanding the core fundamentals of Java. It helps you to learn following topics: <br><br>1) Introduction to Java <br>2) Java Timeline <br>3) Features of Java <br>4) How does Java work? <br>5) Data Types in Java <br>6) Operators in Java <br>7) Functions in Java <br>8) Object Oriented Concepts in Java
E N D
` EDUREKA JAVA CERTIFICATION TRAINING What is Hadoop? https://www.edureka.co/java-j2ee-soa-training
Agenda For Today ➢ Introduction Java ➢ Timeline of Java ➢ Features of Java ➢ Java Environment ` ➢ How does Java work? ➢ Data Types in Java ➢ Operators in Java ➢ Functions in Java ➢ Object Oriented Concepts in Java EDUREKA JAVA CERTIFICATION TRAINING https://www.edureka.co/java-j2ee-soa-training
Introduction Java ` EDUREKA JAVA CERTIFICATION TRAINING https://www.edureka.co/java-j2ee-soa-training
What is Java? ➢ Java was created by a team lead by James Gosling in 1995 for Sun Microsystems. ➢ Java is concurrent, class-based and object-oriented programming language ➢ Java is a platform independent programming language that follows the logic of “Write once, Run anywhere”. ` EDUREKA JAVA CERTIFICATION TRAINING https://www.edureka.co/java-j2ee-soa-training
Java Timeline Java 6 Mustang Java 1.4 Merlin Java 1.2 Playground Java 1.0 Oak Java 8 September 2004 May 2000 July 2011 February 1997 ` January 1996 February 2002 December 2006 December 1998 March 2014 Java 7 Dolphin Java1.3 Kestrel Java 1.1 Java 5 Tiger EDUREKA JAVA CERTIFICATION TRAINING https://www.edureka.co/java-j2ee-soa-training
Java Editions ➢ There are mainly 3 editions of Java that are available today: Java Standard Edition ` Java Java Enterprise Edition Java Micro Edition EDUREKA JAVA CERTIFICATION TRAINING https://www.edureka.co/java-j2ee-soa-training
Features of Java {OOPS} {OOPS} Secure Object-oriented Portable Simple ` Dynamic Distributed Robust High Performance EDUREKA JAVA CERTIFICATION TRAINING https://www.edureka.co/java-j2ee-soa-training
Features of Java Feature of Java Simple Portable Object-oriented ➢ Java was designed to be easy for professional programmer to learn and use effectively. ` Secure Distributed Simple Dynamic Robust High Performance EDUREKA JAVA CERTIFICATION TRAINING https://www.edureka.co/java-j2ee-soa-training
Features of Java Feature of Java Simple Portable ➢ Applications written using Java are portable in the sense that they can be executed on any kind of computer containing any CPU or any operating system. Object-oriented ` Secure Distributed Portable Dynamic Robust High Performance EDUREKA JAVA CERTIFICATION TRAINING https://www.edureka.co/java-j2ee-soa-training
Features of Java Feature of Java Simple Portable ➢ Java is true object oriented language. ➢ Everything is considered to be an “object” and all operations are performed using these objects. Object-oriented {OOPS} {OOPS} ` Secure Distributed Object-oriented Dynamic Robust High Performance EDUREKA JAVA CERTIFICATION TRAINING https://www.edureka.co/java-j2ee-soa-training
Features of Java Feature of Java Simple Portable ➢ Java Programs run inside virtual machine sandbox to prevent any activity from untrusted sources. ➢ No use of explicit pointer. Object-oriented ` Secure Distributed Secure Dynamic Robust High Performance EDUREKA JAVA CERTIFICATION TRAINING https://www.edureka.co/java-j2ee-soa-training
Features of Java Feature of Java Simple Portable ➢ Java has a feature called Remote Method Invocation (RMI) using which a program can invoke method of another program across a network and get the output. Object-oriented ` Secure Distributed Distributed Dynamic Robust High Performance EDUREKA JAVA CERTIFICATION TRAINING https://www.edureka.co/java-j2ee-soa-training
Features of Java Feature of Java Simple Portable ➢ Java programs carry with them substantial amounts of run-time type information that is used to verify and resolve accesses to objects at run time. Object-oriented ` Secure Distributed Dynamic Dynamic Robust High Performance EDUREKA JAVA CERTIFICATION TRAINING https://www.edureka.co/java-j2ee-soa-training
Features of Java Feature of Java Simple Portable ➢ Java checks the code during the compilation time and run time also. ➢ Java completely takes care of memory allocation and releasing, which makes the Java program more robust. Object-oriented ` Secure Distributed Robust Dynamic Robust High Performance EDUREKA JAVA CERTIFICATION TRAINING https://www.edureka.co/java-j2ee-soa-training
Features of Java Feature of Java Simple Portable Object-oriented ➢ Java achieves high performance through the use of bytecode which can be easily translated into native machine code. ` Secure Distributed High Performance Dynamic Robust High Performance EDUREKA JAVA CERTIFICATION TRAINING https://www.edureka.co/java-j2ee-soa-training
Java Environment JVM (Java Virtual Machine) is an abstract machine. It is a specification that provides runtime environment in which java bytecode can be executed. JDK JRE JRE (Java Runtime Environment) is a runtime environment which implements JVM and provides all class libraries and other files that JVM uses at runtime. Development tools ` Java Class Libraries JVM JDK(Java Development Kit) is the tool necessary to compile, document and package Java programs. The JDK completely includes JRE. EDUREKA JAVA CERTIFICATION TRAINING https://www.edureka.co/java-j2ee-soa-training
How does Java work? Java C Compiler Java Source (.java) Java Bytecode ` JVM Java Java is easy Interpreter JIT Compiler Object Code EDUREKA JAVA CERTIFICATION TRAINING https://www.edureka.co/java-j2ee-soa-training
Installation ` EDUREKA JAVA CERTIFICATION TRAINING https://www.edureka.co/java-j2ee-soa-training
Java Installation Go to http://www.oracle.com/technetw ork/java/javase/downloads 1 ` Download Java Platform(JDK) version 8 update 121 and install on your Windows system 2 EDUREKA JAVA CERTIFICATION TRAINING https://www.edureka.co/java-j2ee-soa-training
Java Installation To set the permanent path of JDK in your system: 1 1. Begin by going to My Computer Properties. 2 2. Click on Advanced system setting. ` 3. Click on Environment Variables option 4 4. Select Path variable to edit 5. Enter the path to bin folder inside JDK installed on your system.( Default path is C:\Program Files\Java\jdk1.8.0_121\bin ) 5 3 EDUREKA JAVA CERTIFICATION TRAINING https://www.edureka.co/java-j2ee-soa-training
Eclipse IDE Installation Go to www.eclipse.org 1 Download Eclipse Neon installer and install on your Windows system 2 ` EDUREKA JAVA CERTIFICATION TRAINING https://www.edureka.co/java-j2ee-soa-training
Structure of Java Program Package Details Class Data Members Members Functions ` Main Functions EDUREKA JAVA CERTIFICATION TRAINING https://www.edureka.co/java-j2ee-soa-training
Data Types in Java Primitive Data Type Boolean Character Float Integer ` char bool double float byte int long short EDUREKA JAVA CERTIFICATION TRAINING https://www.edureka.co/java-j2ee-soa-training
Data Types in Java Data Type Value Bytes Required byte -128 to 127 1 short -32768 to 32767 2 int -2147483648 to 2147483647 4 -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 ` long 8 float ±3.40282347E+38F 4 double ±1.79769313486231570E+308 8 char 0 to 65,536 2 boolean true or false 1(bit) EDUREKA JAVA CERTIFICATION TRAINING https://www.edureka.co/java-j2ee-soa-training
Data Operators in Java 1 Arithmetic Operators 2 Unary operators ` 3 Relational operators 4 Logical Operators EDUREKA JAVA CERTIFICATION TRAINING https://www.edureka.co/java-j2ee-soa-training
Arithmetic Operators + >> 2 + 3 5 >> +2 Add two operands or unary plus - >> 3 – 1 2 >> -2 1 Arithmetic Operators Subtract two operands or unary subtract * ` Unary operators 2 >> 2 * 3 6 Multiply two operands Relational operators: 3 / Logical Operators 4 >> 6 / 3 2.0 Divide left operand with the right and result is in float % >> 5 % 3 2 Remainder of the division of left operand by the right EDUREKA JAVA CERTIFICATION TRAINING https://www.edureka.co/java-j2ee-soa-training
Unary operators >> x = 5 ++ Arithmetic Operators 1 >> ++x >> print(x) 6 X++ - Post Increment ++X – Pre Increment Unary operators 2 ` -- >> x-- >> print(x) 4 Relational operators: 3 X-- - Post Decrement --X – Pre Increment Logical Operators 4 EDUREKA JAVA CERTIFICATION TRAINING https://www.edureka.co/java-j2ee-soa-training
Relational operators > >> 2 > 3 False True if left operand is greater than the right < Arithmetic Operators 1 >> 2 < 3 True True if left operand is less than the right Unary operators 2 ` == Relational operators: 3 >>2 == 2 True True if left operand is equal to right Logical Operators 4 != >> x >>= 2 >>print(x) 1 True if left operand is not equal to the right EDUREKA JAVA CERTIFICATION TRAINING https://www.edureka.co/java-j2ee-soa-training
Logical operators and >> True && False False Returns True if both x and y are True, False otherwise Arithmetic Operators 1 or Unary operators 2 >> True || False True Returns True if at least x or y are True, False otherwise ` Relational operators: 3 not Logical Operators 4 >> ! 1 False Returns True if x is False, True otherwise EDUREKA JAVA CERTIFICATION TRAINING https://www.edureka.co/java-j2ee-soa-training
Functions in Java A function is a block of organized, reusable sets of instructions that is used to perform some related actions. ` Built-in Function Why do we use functions? ➢Re – usability of code minimizes redundancy ➢Procedural decomposition makes things organized Function User Defined Function EDUREKA JAVA CERTIFICATION TRAINING https://www.edureka.co/java-j2ee-soa-training
Functions in Java function parameters User Defined Function function definition Syntax: function return value modifier returnType methodName(parameters) { Statements… } ` Example: public static int add(int a, int b) { function call int result; result = a + b; return result; } output EDUREKA JAVA CERTIFICATION TRAINING https://www.edureka.co/java-j2ee-soa-training
Objects ➢ Object is simply a collection of data (State) and methods (Behaviour) that act on those data. State: Color Size Shape • • • ` Behavior: Power On(); Call (); Message (); • • • EDUREKA JAVA CERTIFICATION TRAINING https://www.edureka.co/java-j2ee-soa-training
Class ➢ Class is a blueprint from with the objects are created. class Phone{ String brand; int batteryPower; String processor; . . public Phone(String phoneBrand, int power, String phoneProcessor) { brand = phoneBrand; Batterpower = power; processor = phoneProcessor; } //Other class methods ` Object 1 Object 2 } Object 4 Object 3 EDUREKA JAVA CERTIFICATION TRAINING https://www.edureka.co/java-j2ee-soa-training
Inheritance ➢Inheritance is a mechanism through which one object acquires all the properties and behaviors of parent object. Mobile Super Class ` Child Class Apple Samsung Google EDUREKA JAVA CERTIFICATION TRAINING https://www.edureka.co/java-j2ee-soa-training
Encapsulation ➢Encapsulation is the mechanism that binds together code and the data it manipulates together. ` EDUREKA JAVA CERTIFICATION TRAINING https://www.edureka.co/java-j2ee-soa-training
Polymorphism ➢Polymorphism is the ability of a variable, function or object to take on multiple forms. Mobile ` Camera Remote MP3 Player EDUREKA JAVA CERTIFICATION TRAINING https://www.edureka.co/java-j2ee-soa-training
Abstraction ➢Abstraction is the methodology of hiding the implementation details from the user and only providing the functionality to the users. ` EDUREKA JAVA CERTIFICATION TRAINING https://www.edureka.co/java-j2ee-soa-training
Session In A Minute Features of Java Java Introduction Java Environment ` How does Java work Data Types in Java Data Operators in Java EDUREKA JAVA CERTIFICATION TRAINING https://www.edureka.co/java-j2ee-soa-training
Session In A Minute OOPS Functions in Java ` EDUREKA JAVA CERTIFICATION TRAINING https://www.edureka.co/java-j2ee-soa-training