Introduction of Java
Skip to main content

Introduction of Java

 


introduction of java, introduction of java pdf, introduction of java programming, introduction of javascript




Introduction in Java:-  This blog is free to learning online Java Programming Language. There is you find a brief explanation of every tutorial with example at this blog. If you beginners there is the right place to learn Java Programming Language. If you experienced then there is refreshing your knowledge.

What is a Java?

Ø Java is object oriented programming language that produces software for multiple platforms.

Ø Java has developed by Sun Microsystems Inc in 1991.

Ø At the initial level its called a “Oak” but its was renamed “JAVA” in 1995.

Ø Java was developed by  James GoslingPatrickED Frank and Mike Sheridan.

 

What is JVM?

JVM is called  Java virtual machine. This is act as run time engine. That is use to run a Java programs at a run time. JVM is used to call a main method  that you used in your source code.


 

JVM Working:- JVM have a two work first convert Java source code into Intermediate code that is called Byte code through a Java Compiler. There is generate a .class file. That .class file you directly run into other operating systems. In a java any program you want compile then you use a JAVAC in command prompt.

           When Java program has compiled then JVM have a second work is the Byte code convert into Machine code through a Java Interpreter.  for run a interpreter you write into your command prompt JAVA classname then you get a Output of the program.

 

What is JRE ?

            JRE is called a Java Runtime Environment. JRE is provide a environment there Java Program is execute. for example you compile your Java program then Java Virtual Machine  (JVM)  is convert into Bytecode there its generate at .class file that .class file you run any platform only require a JRE.

 




Most Read:-Difference between method overloading and overriding?


What is JDK ?

       JDK is called a Java Development Kit. It is internally contains  Java Runtime Environment (JRE) and Java Virtual Machine (JVM). Java Development Kit provides all  tools  which is used in Java or require in Java.  If you are a Java developer or Student and you starting a to development a program in a Java then you install a JDK  that contains all require things for example Applets, compiler and Interpreter and archive files (jar files).

 

JDK Tool Download from:- JDK Setup download

 

What is Package ?

            package is contains number of classes, interfaces annotation and sub package of same type into a particular group.

 

Package is two type of package :-

1.     Pre Defined Package:- Java developer had already created all package  that uses is already defined. That use as a developer require. Some packages such as java.lang, Java util, Java io etc.

 

2.     User Defined Package:-  this type of  package define by the user with a unique identity .  we using a “package “ keyword  for defined a package. For example:- package package_name;

In a User is defined package user can defined a access modifier like public, private and protected.

 

First Program in Java:-

      class Hello{

                       public static void main(String [] args){

                   System.out.println(“Hello Java”);

        }

}

Output:- Hello Java


Explanations of use in this program used in 

Class:- Class is collection of the Objects. It is a logical entity. Class does not consume any memory.

public : The public keyword is an access modifier, which allows the programmer to control the visibility of class members. When a class member is preceded by public, then that member may be accessed by code outside the class in which it is declared. In our case the main() method must be declared as public, since it must be called by code outside of its class when the program is started.

static : The keyword static allows main() to be called without having to instantiate a particular instance of the class. This is necessary because main() is called by Java Virtual Machine (JVM) before any objects are made.

void : The keyword void simply tells the compiler that main() does not return a value.

main : It is the method name. The main() method is the entry point of the Java Virtual Machine (JVM) into the java program. JVM launches the java program by invoking the main() method. A complex program will have loads of classes, only one of which will need to have a main() method to get things started.

String args[] - Any information that we need to pass to a method is received by variables specified within the set of parenthesis that follow the name of the method . These variables are called parametersString args[] declares a parameter named args, which is an array of instances of the class String. In this case, args receive any command line arguments present when the program is executed.

System – System is a final class in java.lang package

out – Out is a static member of System class and is object of PrintStream

println()- println is a method of PrintStream which prints whatever is passed to it on the standard output or your screen


Most Read:-Interface in Java with example


Post a Comment

0 Comments