Wednesday, 11 July 2018

How we can compile and run java file

Morning Everybody

In this article today we are going to learn " How we can compile and run java file ". So let`s get started.


Figure shown below:


How java file is compile and run
How java file is compile and run


First of all we need to download and install JDK then create file with .java extension. After creating file we need to compile this file using javac compiler.


If file has no error then java compile (javac) generate a .class file (byte code) and this class file is machine readable so it run on any platform (OS).


Now JVM load and verify this .class file than JVM is execute .class file and provides run time environment.


Thank you. Have a nice day.

" Be Student , Be Curious "

For more detail watch this video :









Introduction of JDK, JRE and JVM

Morning Everybody

 
In this article today we are going to learn " Introduction of JDK, JRE and JVM ". So let`s get started.




1) JDK:


                                               
JDK stands for “Java Development Kit “. It is used to create and run java application. It contains JRE, interpreter, compiler (javac), Java Archiver (JAR), document generator (javadoc) and some other tools for application development.


To running java applications simply download JRE only. But if we want create and run java application we need to download and install JDK.
     

2) JRE:

 

JRE stands for “Java Runtime Environment “. It is part of the JDK but it also download seperatly.It is a set of software tools to run the java application.
           
It contains JVM (Java Virtual Machine), platform core classes, AWT, Swing, JNDI, JDBC, RMI and other supporting libraries.
            

2) JVM:

       
JVM stands for “Java Virtual Machine “.It is part of the JRE. It is an abstraction layer between Java application and underlying platform (OS).In other word JVM is used to execute the java application.
 


This below figure is shown the brief internal structure of JDK:

jvm , jre , jdk
Internal structure of JDK

 In above figure JDK contains  JRE  and  Development Tools.



1) JRE:

 

JRE is used to run the java applications.It contain two sub components JVM and other files file. JVM is used to interpret the byte code. During interpretation JVM require some other file for executing a byte code.


2) Tools or Development tools:

 

Development tools is use to developing java application. 


Thank you. Have a nice day.


" Be Student , Be Curious "


For more detail watch this video :








Saturday, 7 July 2018

Introduction of packages and access modifier in Java

Morning Everybody

In this article today we are going to learn " Introduction of packages and access modifier in Java ". So let`s get started.

1) Packages:


A package is group of java classes, interfaces and sub packages. There are types of packages.


1) Built-in packages: 

Java provide many built in packages like java, lang, util, sql etc.

2) User Define packages:

User can create own package is call user define package.

2) Access Modifier: 


It defines the accessibility of data member (Variable) and member method (function). There are four types of access modifier in java are as follows:


1) Public: 

If we assign public access modifier to class members than it can access by any class.

2) Default:

If we assign don`t any access modifier to class members than it treated as default. It behaves like public access modifier in same package.

3) protected: 

If we assign protected access modifier to class members than it can access in same class and it`s child class and also use in other package with inheritance.

4) Private:

If we assign private access modifier to class members than it can access by same class public members only.


Thank you. Have a nice day.


" Be Student , Be Curious "


For more detail watch this video :