basics of java programming language

11
Basics of Java Basics of Java Programming Language Programming Language @Masudul Hasan @Masudul Hasan Email:[email protected] Email:[email protected]

Upload: masud33bd

Post on 13-Jul-2015

174 views

Category:

Presentations & Public Speaking


1 download

TRANSCRIPT

Page 1: Basics of java programming language

Basics of Java Basics of Java Programming LanguageProgramming Language

@Masudul Hasan@Masudul HasanEmail:[email protected]:[email protected]

Page 2: Basics of java programming language

A presentation with the diagram A presentation with the diagram explaining the difference types of explaining the difference types of

important Java topicsimportant Java topics

Java fileJava file Class fileClass file BytecodeBytecode JarJar JvmJvm

JdkJdk JreJre Heap memory Heap memory PermgenPermgen ThreadThread

JdkJdk JreJre Heap memory Heap memory PermgenPermgen ThreadThread

Page 3: Basics of java programming language

Definition of Java file, Class file, Bytecode and Definition of Java file, Class file, Bytecode and JAR JAR

Java file: A java file is a text file or source code file written in java Java file: A java file is a text file or source code file written in java programming language that contains one or more class definitions. The programming language that contains one or more class definitions. The java compiler requires that a source file use the java compiler requires that a source file use the .java.java filename filename extension which is four character long. If a source file has more than one extension which is four character long. If a source file has more than one class, each class is compiled into a separate class file. class, each class is compiled into a separate class file. Class file: Java class file is a file (with the .class filename extension) Class file: Java class file is a file (with the .class filename extension) containing a Java bytecode which can be executed on the Java Virtual containing a Java bytecode which can be executed on the Java Virtual Machine (JVM). Machine (JVM). Bytecode: Bytecode is a highly optimized set of instructions designed Bytecode: Bytecode is a highly optimized set of instructions designed to be executed by the Java run-time system, which is called Java Virtual to be executed by the Java run-time system, which is called Java Virtual Machine (JVM) .Machine (JVM) . JAR (Java ARchive) :  JAR is a package file format typically used to JAR (Java ARchive) :  JAR is a package file format typically used to aggregate many Java class files and associated metadata and aggregate many Java class files and associated metadata and resources (text, images, etc.) into one file to distribute application resources (text, images, etc.) into one file to distribute application software or libraries on the Java platform.software or libraries on the Java platform.

Page 4: Basics of java programming language

Relationship among JVM, JDK, JRERelationship among JVM, JDK, JRE

JVM (Java Virtual Machine)JVM (Java Virtual Machine)- - JVM is an interpreter for bytecodeJVM is an interpreter for bytecode- Run the byte codeRun the byte code- Makes java platform independentMakes java platform independent- Handles memory managementHandles memory management JDK (Java Development Kit): It provides all the needed support for JDK (Java Development Kit): It provides all the needed support for

software development in java.software development in java. JRE (Java Runtime Environment): Java standard class libraries JRE (Java Runtime Environment): Java standard class libraries

which provide API (Application Programming Interface) and JVM which provide API (Application Programming Interface) and JVM (Java Virtual Machine) together form JRE.(Java Virtual Machine) together form JRE.

Page 5: Basics of java programming language

Relationship among Java file, Class file, Bytecode, Relationship among Java file, Class file, Bytecode, JVM and JRE(JVM+library classes)JVM and JRE(JVM+library classes)

Page 6: Basics of java programming language

Relationship among JDK, JRE, JVMRelationship among JDK, JRE, JVMby diagramby diagram

Page 7: Basics of java programming language

Memory BasicsMemory Basics

Heap memory: When a Java program started Java Virtual Machine Heap memory: When a Java program started Java Virtual Machine gets some memory from Operating System. Java Virtual Machine or gets some memory from Operating System. Java Virtual Machine or JVM uses this memory for all its need and part of this memory is JVM uses this memory for all its need and part of this memory is call call java heap memoryjava heap memory . Heap in Java generally located at bottom . Heap in Java generally located at bottom of address space and move upwards. whenever we create object of address space and move upwards. whenever we create object using new operator or by any another means object is allocated using new operator or by any another means object is allocated memory from Heap and When object dies or garbage collected memory from Heap and When object dies or garbage collected memory goes back to memory goes back to Heap spaceHeap space  in Java. in Java.

Permgen: Perm generation refers to the Permgen: Perm generation refers to the spacespace on the heap where on the heap where all the loaded classes are stored. It's exclusively used to store the all the loaded classes are stored. It's exclusively used to store the class definitions. class definitions.

Thread: Thread in Java is an independent path of execution which is Thread: Thread in Java is an independent path of execution which is used to run two task in parallel. When two Threads run in parallel used to run two task in parallel. When two Threads run in parallel that is called multi-threading in Java.  that is called multi-threading in Java. 

Page 8: Basics of java programming language

Screen shot of heap Screen shot of heap of eclipse using JVisualVMof eclipse using JVisualVM

Page 9: Basics of java programming language

Running threads of eclipse using JVisualVMRunning threads of eclipse using JVisualVM

Page 10: Basics of java programming language

Screen shot of Screen shot of CPU, Heap ,Class and Threads of CPU, Heap ,Class and Threads of eclipse using JVisualVMeclipse using JVisualVM

Page 11: Basics of java programming language

ReferencesReferences[1]: [1]: https://www.youtube.com/watch?v=_MYiF7VBOgYhttps://www.youtube.com/watch?v=_MYiF7VBOgY[2]: https://www.youtube.com/watch?v=eaAqwTdUAAo[2]: https://www.youtube.com/watch?v=eaAqwTdUAAo