Thanks to visit codestin.com
Credit goes to www.slideshare.net

Basics of JavaBasics of Java
Programming LanguageProgramming Language
@Masudul Hasan@Masudul Hasan
Email:masud33_bd@yahoo.comEmail:masud33_bd@yahoo.com
A presentation with the diagramA presentation with the diagram
explaining the difference types ofexplaining the difference types of
important Java topicsimportant Java topics
 Java fileJava file
 Class fileClass file
 BytecodeBytecode
 JarJar
 JvmJvm
 JdkJdk
 JreJre
 Heap memoryHeap memory
 PermgenPermgen
 ThreadThread
 JdkJdk
 JreJre
 Heap memoryHeap memory
 PermgenPermgen
 ThreadThread
Definition of Java file, Class file, Bytecode andDefinition of Java file, Class file, Bytecode and
JARJAR
 Java file: A java file is a text file or source code file written in javaJava file: A java file is a text file or source code file written in java
programming language that contains one or more class definitions. Theprogramming language that contains one or more class definitions. The
java compiler requires that a source file use thejava compiler requires that a source file use the .java.java filenamefilename
extension which is four character long. If a source file has more than oneextension 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 Virtualcontaining a Java bytecode which can be executed on the Java Virtual
Machine (JVM).Machine (JVM).
 Bytecode: Bytecode is a highly optimized set of instructions designedBytecode: Bytecode is a highly optimized set of instructions designed
to be executed by the Java run-time system, which is called Java Virtualto 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 toJAR (Java ARchive) :  JAR is a package file format typically used to
aggregate many Java class files and associated metadata andaggregate many Java class files and associated metadata and
resources (text, images, etc.) into one file to distribute applicationresources (text, images, etc.) into one file to distribute application
software or libraries on the Java platform.software or libraries on the Java platform.
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 forJDK (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 librariesJRE (Java Runtime Environment): Java standard class libraries
which provide API (Application Programming Interface) and JVMwhich provide API (Application Programming Interface) and JVM
(Java Virtual Machine) together form JRE.(Java Virtual Machine) together form JRE.
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)
Relationship among JDK, JRE, JVMRelationship among JDK, JRE, JVM
by diagramby diagram
Memory BasicsMemory Basics
 Heap memory: When a Java program started Java Virtual MachineHeap memory: When a Java program started Java Virtual Machine
gets some memory from Operating System. Java Virtual Machine orgets some memory from Operating System. Java Virtual Machine or
JVM uses this memory for all its need and part of this memory isJVM 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 objectof address space and move upwards. whenever we create object
using new operator or by any another means object is allocatedusing new operator or by any another means object is allocated
memory from Heap and When object dies or garbage collectedmemory 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 thePermgen: Perm generation refers to the spacespace on the heap whereon the heap where
all the loaded classes are stored. It's exclusively used to store theall 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 isThread: Thread in Java is an independent path of execution which is
used to run two task in parallel. When two Threads run in parallelused 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. 
Screen shot of heapScreen shot of heap of eclipse using JVisualVMof eclipse using JVisualVM
Running threads of eclipse using JVisualVMRunning threads of eclipse using JVisualVM
Screen shot ofScreen shot of CPU, Heap ,Class and Threads ofCPU, Heap ,Class and Threads of
eclipse using JVisualVMeclipse using JVisualVM
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

Basics of java programming language

  • 1.
    Basics of JavaBasicsof Java Programming LanguageProgramming Language @Masudul Hasan@Masudul Hasan Email:[email protected]:[email protected]
  • 2.
    A presentation withthe diagramA presentation with the diagram explaining the difference types ofexplaining the difference types of important Java topicsimportant Java topics  Java fileJava file  Class fileClass file  BytecodeBytecode  JarJar  JvmJvm  JdkJdk  JreJre  Heap memoryHeap memory  PermgenPermgen  ThreadThread  JdkJdk  JreJre  Heap memoryHeap memory  PermgenPermgen  ThreadThread
  • 3.
    Definition of Javafile, Class file, Bytecode andDefinition of Java file, Class file, Bytecode and JARJAR  Java file: A java file is a text file or source code file written in javaJava file: A java file is a text file or source code file written in java programming language that contains one or more class definitions. Theprogramming language that contains one or more class definitions. The java compiler requires that a source file use thejava compiler requires that a source file use the .java.java filenamefilename extension which is four character long. If a source file has more than oneextension 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 Virtualcontaining a Java bytecode which can be executed on the Java Virtual Machine (JVM).Machine (JVM).  Bytecode: Bytecode is a highly optimized set of instructions designedBytecode: Bytecode is a highly optimized set of instructions designed to be executed by the Java run-time system, which is called Java Virtualto 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 toJAR (Java ARchive) :  JAR is a package file format typically used to aggregate many Java class files and associated metadata andaggregate many Java class files and associated metadata and resources (text, images, etc.) into one file to distribute applicationresources (text, images, etc.) into one file to distribute application software or libraries on the Java platform.software or libraries on the Java platform.
  • 4.
    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 forJDK (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 librariesJRE (Java Runtime Environment): Java standard class libraries which provide API (Application Programming Interface) and JVMwhich provide API (Application Programming Interface) and JVM (Java Virtual Machine) together form JRE.(Java Virtual Machine) together form JRE.
  • 5.
    Relationship among Javafile, Class file, Bytecode,Relationship among Java file, Class file, Bytecode, JVM and JRE(JVM+library classes)JVM and JRE(JVM+library classes)
  • 6.
    Relationship among JDK,JRE, JVMRelationship among JDK, JRE, JVM by diagramby diagram
  • 7.
    Memory BasicsMemory Basics Heap memory: When a Java program started Java Virtual MachineHeap memory: When a Java program started Java Virtual Machine gets some memory from Operating System. Java Virtual Machine orgets some memory from Operating System. Java Virtual Machine or JVM uses this memory for all its need and part of this memory isJVM 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 objectof address space and move upwards. whenever we create object using new operator or by any another means object is allocatedusing new operator or by any another means object is allocated memory from Heap and When object dies or garbage collectedmemory 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 thePermgen: Perm generation refers to the spacespace on the heap whereon the heap where all the loaded classes are stored. It's exclusively used to store theall 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 isThread: Thread in Java is an independent path of execution which is used to run two task in parallel. When two Threads run in parallelused 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. 
  • 8.
    Screen shot ofheapScreen shot of heap of eclipse using JVisualVMof eclipse using JVisualVM
  • 9.
    Running threads ofeclipse using JVisualVMRunning threads of eclipse using JVisualVM
  • 10.
    Screen shot ofScreenshot of CPU, Heap ,Class and Threads ofCPU, Heap ,Class and Threads of eclipse using JVisualVMeclipse using JVisualVM
  • 11.