What is Java? , java introduction, Java definition, Java Fundamental











About Java:-

Java is complete technology which is used to create small scale to large scale application’s using Java Programming language, Java Development Kit and Java Frameworks.


Java Technology Provide a complete platform to compile and execute the java program code using JDK and JRE.


Java Technology uses JVM (Java virtual machine ) to execute java byte code to any operating system hence Java is platform-independent but JVM dependent.

JVM is a subpart of JRE which is also called the virtual operating system of Java.


About Java Programming language:-

Java programming language is an Object-oriented programming language which is used to create a real-world based application to end-users.


Java Programming language provides better security, reusability, accessibility, and dynamic memory allocation for real-time applications.


Java programming language is an operating system independent language because java program will be executed by JVM, not by the operating system.

When we compile Java Program code then it will convert into byte code by Java compiler, Byte code will be executed by JVM (Java Virtual Machine), not by operating system hence JAVA Byte Code is Operating System free.


Hello.java---------------->(Compile)----> Byte Code----->(Load by JVM Class Loader) ------> JVM---->(convert)-------->Machine code using JIT (Just in time compiler)




Software Tool For Java:-
........................................................................

How to download Java from the internet:-

https://www.oracle.com/in/java/technologies/javase/javase-jdk8-downloads.html

1 JDK + JRE 

 JDK (Java Development Kit)

it is used to compile java program code to byte code.

.java ----> .class conversion will be managed by JDK.

JRE  (JAVA Runtime Environment)

it is used to execute byte code(class file) to machine code using JVM(Java Virtual Machine).

JVM is the virtual executor for java program code but JVM is operating System dependent. Linux JVM and Windows JVM both will be different.

but .class file is common for all JVM.


note:-  for a developer or learner machine:-  JDK+JRE

for client machine:-   JRE (Java runtime environment)

................................................................................................................................................

How we check Java is installed in the machine?

go on program files and check Java (JDK+JRE)


How we check that the Java path is set or not?

open command prompt and type javac.
if javac describes then the path is set.

internal or external command problem then the path is not set.

How we set the path?

1 temp path:-

 without admin permission, we can set this path .simple copy default path of java

c:/program files/java/jdk/bin

set path=C:\Program Files\Java\jdk1.8.0_161\bin.

When the command prompt will be closed then the path will reset.


2 permanent path:-

right click on mycomputer----> properties---> advance system setting--->environment variable----> new 

wind
variable name    path
variable value    C:\Program Files\Java\jdk1.8.0_161\bin
press ok, ok and ok
restart command prompt


CREATE the FIRST PROGRAM OF JAVA:-

1  Open notepad and write code

class Classname
{
   public static void main(String args[])
   {
          System.out.println("statement");
   }

}


2 Save this program using .java file

    Classname.java 

3  Compile this program

    javac Classname.java

4 Execute this program

    java Classname    


Assignment:- 

WAP to calculate simple interest?
Solution:-
class SI
{
   
   public static void main(String args[])
  {
      float p,r,t,si;
      p=10000;
      r=2;
      t=2;
      si=(p*r*t)/100;
      System.out.println("result is ="+si);
 

  }



}

WAP to reverse a five-digit number without using a loop?

The solution of this program;-

class Reverseexample
{
    public static void main(String args[])
    {
           int num = 12345;
           int a = num%10;
           num = num/10;
           int b = num%10;
           num = num/10;
           int c = num%10;
           num = num/10;
           int d = num%10;
           int e = num/10;
           int rev = a*10000+b*1000+c*100+d*10+e*1;
           System.out.print(rev); 
           

    }


}


WAP to Swap two numbers?





Create a Program to print name, email, mobile, and date of the birth field?

class Biodata
{
  public static void main(String args[])
  {
     String name,email,mobile,dob;
     name= "manish kumar";
     email= "manishkumar@gmail.com";
     mobile= "9812312345";
     dob="10/06/1998";
     System.out.println("name is "+name);
     System.out.println("email is "+email);
     System.out.println("mobile no is "+mobile);
     System.out.println("dob is "+dob);
       
     }

}





next blog :- blogger.com/blog/post/edit/7768209714160124788/654171578962694264

Post a Comment

If you have any doubt in programming or join online classes then you can contact us by comment .

Previous Post Next Post