Tuesday, 15 August 2017

Explaination of JDK,JRE & JVM and First Programe in Java

Why we use Public static void main(String args[])
In the above application example we are using public static void main(). Each word has a different meaning and purpose in java.

Public : is an Access Modifier, which defines who can access this Method. Public means that this Method will be accessible by any Class.

Static : it is access modifier that means when the java program is load then it will create the space in memory automatically.

Void : is used to define the Return Type of the Method. it is a return type i.e it does not return any value.

main: Name of function or method.

String args[] : is the parameter to the main Method.


Java Simple programme:

Code
class HelloWorld
{
            Public static void main(String args[])
            {
                        System.out.println("Hello Technewsncareer");
            }
}
Output:
Hello Technewsncareer


What is System.out.println() :

System is a class in the java.lang package.

out is a static member of the System class, and is an instance of java.io.PrintStream .

println is a method of java.io.PrintStream .

JDK,JVM,JRE

JDK,JRE & JVM

JDK:
Java Development Kit is the core component of Java Environment and supply all the tools, executables and binaries required to compile, debug and execute a Java Program. JDK is a platform specific software and thats why we have separate installers for Windows, Mac and Unix systems. We can say that JDK is superset of JRE since it contains JRE with Java compiler, debugger and core classes. Current version of JDK is 1.8 also known as Java 8.

JVM
JVM is the heart of java programming language. When we run a program, JVM is liable to converting Byte code to the machine code. JVM is also platform dependent and provides core java functions like memory management, garbage collection, security etc. JVM is customizable and we can use java options to customize it, for example allocating minimum and maximum memory to JVM. JVM is called virtual because it provides an interface that does not depend on the fundamental operating system and machine hardware. This independence from hardware and operating system is what makes java program “write-once run-anywhere”.

JRE
JRE is the implementation of JVM, it provides platform to execute java programs. JRE consists of JVM and java binaries and other classes to execute any program successfully. JRE doesn’t contain any development tools like java compiler, debugger etc. If you want to run any java program, you must have JRE installed but we don’t need JDK for running any java program.
In this post we learned meaning of each keyword in public static void main() and System.out.println().next post will be about  data types in java.

1 comments:

  1. Thanks a lot very much for the high quality and results-oriented help. I won’t think twice to endorse your blog post to anybody who wants and needs support

    about this area.
    hadoop training in

    bangalore

    ReplyDelete