JVM Introduction

58


What is JVM?

JVM means Java Virtual Machine, It provides a complete Runtime Environment to Execute Java Byte Code.
JVM is the part of JRE means when we install JRE in the machine then JVM Environment will be created by default.
JVM Component:-
JVM Architecture?
JVM means Java Virtual Machine, It will divide the complete runtime environment into four different parts.
1)  ClassLoader SubSystem:-
  1.1)  Loading  --->  When we execute the program the loader will load the class files using Bootstrap, extension, and application loader.
  1.2)  Linking  ---->  It is used to link all libraries of byte code that will be used into the java program
  1.3)  Initialization--->  after successfully loading and linking, the byte code file will be initialized into memory.
2)  Memory Area
 2.1)  Stack Memory:-  
It is used to store the data for value type data type
for example, int, char, float, boolean, and all primitive data type elements store data under stack memory.
 2.2)  Heap Memory:-
It is used to store the data for reference type of data type such as Object, String, String Buffer etc
 2.3)  Method Area:-
It is used to contain the data of Methods of class.
 2.4)  PC Register:-
  It is used to solve the expression of any mathematical, logical, and conditional expression in the program.
 2.5)  Native Method Stack:-
   It is used to contain the references of c and c++ languages and store them. 
3)  Execution Engine
 3.1)  Interpretar:-  It is used to read the byte code line by line and process it's output.
   3.2)  JIT:-  It is used to convert byte code to machine code.it means Just-In-Time Compiler.
 3.3)  GC:-  It means Garbage Collector, it is used to provide automatic memory management.
    
4)  Native Method Library 
4.1)  JNI  (Java Native Interface):-  It is used to execute other programming code(c and c++) and convert it into machine code.
4.2)  Native Method Library:-  It is used to contain the library of C and C++ languages and integrate it into java byte code.


ASSIGNMENTS on Java:-
q1)     WAP to convert feet to inch and inch to feet?
q2)     WAP to convert cm to meter and meter to CM?
q3)   WAP to calculate compund interest?
Solution:-
class CI
{
   public static void main(String args[])
   {
      double p=50000,r=9.2,t=5,n=12;
      double a;
      double R = r/100; 
      a = p* Math.pow((1+(R/n)),n*t);
      System.out.println(a);
      System.out.println(a-p);
        }
}
q4)  WAP to calculate the square and cube of any assigned number?
q5)  WAP to convert  hectare to acre?
Tags

Post a Comment

58Comments

POST Answer of Questions and ASK to Doubt

  1. class I2F
    {
    public static void main(String arg[])
    {
    float inch=1000;
    float feet=inch/12;
    System.out.println(feet);
    }
    }

    ReplyDelete
  2. class CM2M
    {
    public static void main(String arg[])
    {
    float cm=560;
    float m=cm/100;
    float m1=2;
    float cm1=2*100;
    System.out.println(m+"m");
    System.out.println(cm1+"cm");
    }
    }

    ReplyDelete
  3. class Sc
    {
    public static void main(String arg[])
    {
    int n=6;
    int sq=n*n;
    int cb=sq*n;

    System.out.println(sq);
    System.out.println(cb);
    }
    }

    ReplyDelete
  4. class H2A
    {
    public static void main(String arg[])
    {
    int h=41;
    double a= h*2.471;


    System.out.println(a);
    }
    }

    ReplyDelete
  5. nitesh bamotriya

    public class Main
    {
    public static void main(String[] args) {
    double feet=12,inch=144;
    inch=feet*12;
    feet=inch/12;
    System.out.println("inch is"+inch);
    System.out.println("feet is"+feet);
    }
    }

    ReplyDelete
  6. Nitesh bamotriya
    public class Main
    {
    public static void main(String[] args) {
    double m=12,cm=123;
    m=cm/100;
    cm=m*100;
    System.out.println("meter is"+m);
    System.out.println("centimeter is"+cm);
    }
    }

    ReplyDelete
  7. nitesh bamotriya
    public class Main
    {
    public static void main(String[] args) {
    int hect=23;
    double acre=hect*2.471;
    System.out.println("hecter to acre is"+acre);
    }
    }

    ReplyDelete
  8. Nitesh bamotriya
    public class Main
    {
    public static void main(String[] args) {
    int n=21;
    int squre=n*n;
    int cube=squre*n;
    System.out.println("squre is"+squre);
    System.out.println("cube is"+cube);
    }
    }

    ReplyDelete
  9. class cm2
    {
    public static void main(String args[])
    {
    float cm=230;
    float m=cm/100;
    System.out.println("m="+m );

    float m1=8;
    float ml2=8*100;
    System.out.println("ml2="+ml2);

    }
    }

    ReplyDelete
  10. class Sqcb
    {
    public static void main(String args[])
    {
    int a=6,sq,cb;
    sq=a*a;
    cb=sq*a;
    System.out.println("sq="+sq);
    System.out.println("cb="+cb);

    }
    }

    ReplyDelete
  11. class hect
    {
    public static void main(String args[])
    {
    int h=20;
    double a=h*2.471;
    System.out.println("A="+a);
    }
    }

    ReplyDelete
  12. class convert
    {
    public static void main(String args[])
    {
    int inch=124,feet;
    feet=inch/12;
    System.out.println("feet="+feet);

    }
    }

    ReplyDelete
  13. package test;
    import java.util.Scanner;

    public class Selenium_test
    {
    public static void main(String args[])
    {
    Scanner sc=new Scanner(System.in);
    float cm,meter;
    System.out.println("Enter in cm");
    cm=sc.nextFloat();
    meter=cm/100;
    System.out.println("In Meter's"+meter);
    }

    }

    ReplyDelete
  14. class Convertor
    {
    float inch=3,feet=2,inch1,feet1;
    public static void main(String args[])
    {
    Convertor obj;
    obj= new Convertor();
    obj.inch1=12*obj.feet;
    obj.feet1=obj.inch/12;
    System.out.println("inch1" + obj.inch1);
    System.out.println("feet1" + obj.feet1);
    }
    }

    ReplyDelete
  15. import java.lang.Math;
    class Ci
    {
    double p=5000,t=10,n=12,r=0.05,amount,c;
    public static void main(String args[])
    {
    Ci obj;
    obj=new Ci();
    obj.amount=obj.p* (Math.pow(((1+(obj.r/obj.n))),(obj.n*obj.t)));
    obj.c=(obj.amount-obj.p);
    System.out.println(obj.c);


    }
    }

    ReplyDelete
  16. import java.util.Scanner;
    import java.lang.Math;
    class Cube
    {
    public static void main(String args[])
    {
    Scanner sc=new Scanner(System.in);
    double num= sc.nextInt();
    double ans= Math.pow(num,3);
    System.out.println("Ans=" + ans);
    }
    }

    ReplyDelete
  17. //inch to feet
    class InchFeet
    {
    public static void main(String arg[])
    {
    float inch=200;
    float feet=inch/12;
    System.out.println(feet);
    }
    }

    ReplyDelete
  18. import java.util.Scanner;
    class Convert_A
    {


    public static void main(String args[])
    {
    double cm,m,cm1,m1;

    Scanner sc=new Scanner(System.in);
    System.out.println("enter cm value");
    cm=sc.nextInt();
    System.out.println("enter m value");
    m=sc.nextInt();
    m1=cm/100;

    System.out.println("after convert cm in to meter" + m1);

    cm1=m*100;
    System.out.println("after convert meter to cm" + cm1);
    }
    }


    ReplyDelete
  19. //cm to m
    import java.util.Scanner;
    class Cmm
    {
    public static void main(String args[])
    {
    Scanner sc=new Scanner(System.in);
    float meter;
    System.out.println("Enter in cm");
    float cm= sc. nextFloat();
    meter=cm/100;
    System.out.println("In Meter's"+meter);
    }
    }

    ReplyDelete
  20. // WAP to convert feet to inch and inch to feet?

    import java.util.Scanner;
    class Convert
    {
    public static void main(String args[])
    {
    System.out.println("Enter 1 for converting inch to feet and 2 for converting feet to inch");
    Scanner sc = new Scanner(System.in);
    int enter = sc.nextInt();
    if(enter==1)
    {
    System.out.println("Enter inch");
    Scanner sc1 =new Scanner(System.in);
    int inch=sc1.nextInt();
    int feet=inch/12;
    System.out.println(inch+"inch is equal to"+feet+"feet");
    }
    else
    {
    System.out.println("Enter feet");
    Scanner sc2 =new Scanner(System.in);
    int feet=sc2.nextInt();
    int inch=12*feet;
    System.out.println(feet+"feet is equal to "+inch+"inch);
    }
    }
    }

    ReplyDelete
  21. class Cmm
    {
    int Cm=100,m;
    public static void main(String args[])
    {
    Cmm obj;
    obj =new Cmm();
    obj.m=100*obj.Cm;
    System.out.println(obj.m +"m");
    }
    }

    ReplyDelete
  22. WAP to convert feet to inch and inch to feet?


    import java.util.Scanner;
    public class feet2inch{
    public static void main(String args[]){
    Scanner Sc = new Scanner(System.in);
    System.out.print("Feet:");
    double f = Sc.nextInt();
    double I = (f*12);
    System.out.print("Feet to Inch:" +I+ "\n");
    System.out.print("Inch:");
    double i = Sc.nextInt();
    double F = (i/12);
    System.out.print("Inch to Feet:" +F);
    }
    }

    ReplyDelete
  23. WAP to convert cm to meter and meter to CM?

    import java.util.Scanner;
    public class m2cm{
    public static void main(String args[]){
    Scanner Sc=new Scanner(System.in);
    System.out.print("Meter:");
    float m = Sc.nextFloat();
    double CM = (m*100);
    System.out.print("Centimeter:" +CM+ "\n");
    System.out.print("Centimeter:");
    double cm = Sc.nextInt();
    double M = (cm/100);
    System.out.print("Meter:" +M);
    }
    }

    ReplyDelete
  24. WAP to calculate compund interest?


    import java.util.Scanner;
    import java.io.*;
    class ci2{
    public static void main(String args[]){
    Scanner Sc = new Scanner(System.in);
    System.out.println("Principal, Rate, Time in year:");
    double p = Sc.nextInt();
    float r = Sc.nextFloat();
    float t = Sc.nextFloat();
    int n = 12;
    double R = r/100;
    double ci = p*Math.pow(1 +( R / n), t*n);
    System.out.print("Compund Intrest : " +ci+ "\n");
    double i = (ci-p);
    System.out.print("Total Intrest : "+i);
    }
    }

    ReplyDelete
  25. WAP to calculate the square and cube of any assigned number?


    import java.util.Scanner;
    public class sndcube{
    public static void main(String args[]){
    Scanner Sc = new Scanner(System.in);
    System.out.print("Number:");
    double num = Sc.nextInt();
    double S = Math.pow((num),2);
    System.out.print("Square:" +S+ "\n");
    double C = Math.pow((num),3);
    System.out.print("Cube:" +C);
    }
    }

    ReplyDelete
  26. WAP to calculate the square and cube of any assigned number?


    import java.util.Scanner;
    public class sndcube{
    public static void main(String args[]){
    Scanner Sc = new Scanner(System.in);
    System.out.print("Number:");
    double num = Sc.nextInt();
    double S = Math.pow((num),2);
    System.out.print("Square:" +S+ "\n");
    double C = Math.pow((num),3);
    System.out.print("Cube:" +C);
    }
    }

    ReplyDelete
  27. WAP to convert hectare to acre?


    import java.util.Scanner;
    public class acre2h{
    public static void main(String args[]){
    Scanner Sc = new Scanner(System.in);
    System.out.print("Number of Hactare:");
    float h = Sc.nextFloat();
    double A = (h*2.4710538147);
    System.out.print("Acre:" +A+ "\n");
    System.out.print("Number of Acre:");
    float a = Sc.nextFloat();
    double H = (a/2.4710538147);
    System.out.print("Hactare:" +H);
    }
    }

    ReplyDelete
  28. class S2C
    {
    public static void main(String[] args) {

    int a=6,sq,cb;
    sq=a*6;
    cb=sq*a;
    System.out.println("sq="+sq);
    System.out.println("cb="+cb);

    }
    }

    ReplyDelete
  29. WAP to convert cm to meter and meter to CM?

    class C2M
    {
    public static void main(String[] args) {

    double meter,cm,meterout,cmout;
    meter=30;
    meterout = 100*meter;
    cm =40;
    cmout = cm/100;
    System.out.println("meterout is "+meterout);
    System.out.println("cmouts is "+cmout);

    }
    }

    ReplyDelete
  30. WAP to convert hectare to acre?

    class H2A
    {
    public static void main(String[] args) {

    int hect = 247;
    double acr = hect*2.56;
    System.out.println("hect to acr "+acr);

    }

    }

    ReplyDelete
  31. WAP to convert feet to inch and inch to feet?


    class I2F
    {
    public static void main(String[] args) {

    double inch , feet, inchout,feetout;
    inch = 700;
    inchout = 12*inch;
    feet = 44;
    feetout = feet/12;
    System.out.println("inchout is "+inchout);
    System.out.println("feetout is "+feetout);
    }

    }

    ReplyDelete
  32. WAP to calculate compund interest?

    lass CI
    {
    public static void main(String[] args) {


    double p=1500,r=7.5,t=20,n=12,a,R;
    R= r/100;
    a =p*Math.pow(1+(R/n),n*t);
    System.out.println("total amount "+a);
    System.out.println("interet is "+(a-p));
    }
    }

    ReplyDelete
  33. WAP to calculate the square and cube of any assigned number?

    Program-2

    import java.util.Scanner;
    public class sndcube2{
    public static void main(String args[]){
    Scanner Sc = new Scanner(System.in);
    System.out.print("Number:");
    int num = Sc.nextInt();
    int Sq = (num*num);
    int C = (num*num*num);
    System.out.print("Square:" +Sq+ "\n");
    System.out.print("Cube:" +C);
    }
    }

    ReplyDelete
  34. class FeettoInches
    {
    public static void main(String args[]){
    int feet=25;
    float inch;
    inch=12*feet;
    System.out.println("feet to inches:"+inch);
    }
    }

    ReplyDelete
  35. Ankita Verma
    class Object
    {
    int p,t,n A;
    float r,Ci
    public static void main(String args[])
    {
    CI obj=new Ci();
    obj.p=2000;
    obj.t=5;
    obj.r=3;
    obj.A=obj.p(1+obj.r/obj.n).(obj.n*obj.t)

    System.out.println
    System.out.println("acre=" +A);
    System.out.println("Enter the value of acre=");
    float a=sc.nextFloat();
    double H=a/2.471;
    System.out.println("hactare=" +H);

    }
    }

    ReplyDelete
  36. Ankita Verma
    class CM2meter
    {
    public static void main(String args[])
    {
    float cm;
    float meter=8;
    cm=meter*100;
    System.out.println("Value of cm=" +cm);
    cm=12;
    meter=cm/100;
    System.out.println("Value of meter="+meter);
    }
    }

    ReplyDelete
  37. Ankita Verma
    class Inch2feet
    {
    public static void main(String args[])
    {
    float inch;
    float feet=24;
    inch=feet*12;
    System.out.println("Value of inch=" +inch);
    inch=54;
    feet=inch/12;
    System.out.println("Value of feet="+feet);
    }
    }

    ReplyDelete
  38. Ankita Vema
    class Squre
    {
    public static void main(String args[])
    {
    int n=25,squre,cube;
    squre=n*n;
    System.out.println("squre=" +squre);
    n=10;
    cube=squre*n;
    System.out.println("cube=" +cube);
    }
    }

    ReplyDelete

  39. import java.util.Scanner;
    class Convert1
    {
    public static void main(String args[])
    {
    double inch,inchout,feet,feetout;
    Scanner sc=new Scanner(System.in);
    System.out.println("Enter the inch");
    inch=sc.nextDouble();
    System.out.println("Enter the feet");
    feet=sc.nextDouble();
    inchout=12*inch;
    feetout=feet/12;
    System.out.println("inchout is "+inchout);
    System.out.println("feetout is "+feetout);
    }
    }

    ReplyDelete
  40. import java.util.Scanner;
    class M1cm1
    {
    public static void main(String args[])
    {
    Scanner ar=new Scanner(System.in);
    float m,cm;
    System.out.println("Enter the meter=");
    m=ar.nextFloat();
    System.out.println("Enter the centimeter=");
    cm=ar.nextFloat();
    m=cm/100;
    cm=m*100;
    System.out.println("Meter is="+m);
    System.out.println(" centimeter is="+cm);
    }
    }

    ReplyDelete
  41. import java.util.Scanner;
    public class CI1
    {
    public static void main(String args[])
    {
    float p,r,n,t;
    Scanner sc=new Scanner (System.in);

    System.out.println("Enter the principle=");
    p = sc.nextFloat();

    System.out.println("Enter the Rate of interest : ");
    r = sc.nextFloat();

    System.out.println("Enter the Time period : ");
    t = sc.nextFloat();

    System.out.println("Enter the number of times that interest is compounded per unit t");
    n=sc.nextFloat();

    double amount = p * Math.pow(1 + (r / n), n * t);

    double cinterest = amount - p;

    System.out.println("Compound Interest after " + t + " years: "+cinterest);

    System.out.println("Amount after " + t + " years: "+amount);
    }
    }

    ReplyDelete
  42. import java.util.Scanner;

    public class Square1
    {
    public static void main(String args[])
    {
    Scanner sc=new Scanner(System.in);
    int n;
    System.out.println("Enter the number=");
    n=sc.nextInt();

    System.out.println("Square of " + n + " is: " + Math.pow(n, 2));

    System.out.println("Cube of " + n + " is: " + Math.pow(n, 3));

    System.out.println("Square Root of " + n + " is: " + Math.sqrt(n));
    }
    }

    ReplyDelete
  43. import java.util.Scanner;
    public class Acres
    {
    public static void main(String args[])
    {
    Scanner sc=new Scanner(System.in);
    float a,m,h,n;
    System.out.println("Enter the Acres");

    a=sc.nextFloat();
    m=a/2.41f;

    System.out.println("The Hectares is "+m);

    System.out.println("Enter the Hectares");

    h=sc.nextFloat();
    n=h*2.41f;

    System.out.println("The Acres is "+n);
    }
    }

    ReplyDelete
  44. //yogesh seroke
    import java.util.Scanner;
    class Convert1
    {
    public static void main(String args[])
    {
    double inch,inchout,feet,feetout;
    Scanner sc=new Scanner(System.in);
    System.out.println("Enter the inch");
    inch=sc.nextDouble();
    System.out.println("Enter the feet");
    feet=sc.nextDouble();
    inchout=12*inch;
    feetout=feet/12;
    System.out.println("inchout is "+inchout);
    System.out.println("feetout is "+feetout);
    }
    }

    ReplyDelete
  45. //yogesh seroke
    import java.util.Scanner;
    class M1cm1
    {
    public static void main(String args[])
    {
    Scanner ar=new Scanner(System.in);
    float m,cm;
    System.out.println("Enter the meter=");
    m=ar.nextFloat();
    System.out.println("Enter the centimeter=");
    cm=ar.nextFloat();
    m=cm/100;
    cm=m*100;
    System.out.println("Meter is="+m);
    System.out.println(" centimeter is="+cm);
    }
    }

    ReplyDelete
  46. //yogesh seroke
    import java.util.Scanner;
    class M1cm1
    {
    public static void main(String args[])
    {
    Scanner ar=new Scanner(System.in);
    float m,cm;
    System.out.println("Enter the meter=");
    m=ar.nextFloat();
    System.out.println("Enter the centimeter=");
    cm=ar.nextFloat();
    m=cm/100;
    cm=m*100;
    System.out.println("Meter is="+m);
    System.out.println(" centimeter is="+cm);
    }
    }

    ReplyDelete
  47. //yogesh seroke
    import java.util.Scanner;
    public class CI1
    {
    public static void main(String args[])
    {
    float p,r,n,t;
    Scanner sc=new Scanner (System.in);

    System.out.println("Enter the principle=");
    p = sc.nextFloat();

    System.out.println("Enter the Rate of interest : ");
    r = sc.nextFloat();

    System.out.println("Enter the Time period : ");
    t = sc.nextFloat();

    System.out.println("Enter the number of times that interest is compounded per unit t");
    n=sc.nextFloat();

    double amount = p * Math.pow(1 + (r / n), n * t);

    double cinterest = amount - p;

    System.out.println("Compound Interest after " + t + " years: "+cinterest);

    System.out.println("Amount after " + t + " years: "+amount);
    }
    }

    ReplyDelete
  48. //yogesh seroke
    import java.util.Scanner;

    public class Square1
    {
    public static void main(String args[])
    {
    Scanner sc=new Scanner(System.in);
    int n;
    System.out.println("Enter the number=");
    n=sc.nextInt();

    System.out.println("Square of " + n + " is: " + Math.pow(n, 2));

    System.out.println("Cube of " + n + " is: " + Math.pow(n, 3));

    System.out.println("Square Root of " + n + " is: " + Math.sqrt(n));
    }
    }

    ReplyDelete
  49. //yogesh seroke
    import java.util.Scanner;
    public class Acres
    {
    public static void main(String args[])
    {
    Scanner sc=new Scanner(System.in);
    float a,m,h,n;
    System.out.println("Enter the Acres");

    a=sc.nextFloat();
    m=a/2.41f;

    System.out.println("The Hectares is "+m);

    System.out.println("Enter the Hectares");

    h=sc.nextFloat();
    n=h*2.41f;

    System.out.println("The Acres is "+n);
    }
    }

    ReplyDelete
  50. Answer Of Feet To INCH:-
    class FtoI
    {
    public static void main(String args[])
    {

    float ft=12.5F,inch;
    inch = 12*ft;
    System.out.println(ft + "\'" + " to " + inch + "\"");

    }


    }

    ReplyDelete
  51. Calculate Compund Interest
    class CI
    {
    public static void main(String args[])
    {

    double p=50000,r=11.2F,t=3,n=12;
    double R = r/100;
    double ci;
    ci = p*Math.pow(1+R/n,n*t);
    System.out.println("CI is "+(ci-p));


    }


    }

    ReplyDelete
  52. WAP to convert feet into inches and inches into feet.

    package Learningjava;

    import java.util.Scanner;

    public class Feetintoinch {

    public static void main(String[] args)

    {
    // convert feet to inches
    Scanner sc= new Scanner (System.in);
    System.out.println("enter value in feet"); // enter value in feet
    float feet= sc.nextFloat();
    float inch = feet * 12;
    System.out.println("value in inches " + inch); // get value in inches.

    // convert inch to feet
    System.out.println("Enter value in inches");
    inch = sc.nextFloat();
    feet = inch/12;
    System.out.println("value in feets " + feet);

    }

    }

    ReplyDelete
  53. WAP to find compound interest.

    package Learningjava;

    public class Compoundinterest {

    public static void main(String[] args)

    {
    double P = 6000;
    double r = 9;
    double n= 2;

    double A = P*Math.pow((1+(r/100)),n);
    Double ci = A-P;
    System.out.println("Compound interest is " + ci);
    }

    }

    ReplyDelete
  54. WAP to calculate compound interest with user input.

    package Learningjava;

    import java.util.Scanner;
    public class Compoundinterest {

    public static void main(String[] args)

    {

    double princ,rate,nyear, amount;
    System.out.println("enter values Principal, rate, no. of years");
    Scanner sc = new Scanner(System.in);
    princ = sc.nextDouble();
    rate = sc.nextDouble();
    nyear = sc.nextDouble();

    amount = princ*Math.pow((1+(rate/100)),nyear);
    Double ci = amount-princ;
    System.out.println("Compound interest is " + ci);
    }

    }

    ReplyDelete
  55. class compound1
    {
    public static void main(String abc[])
    {
    double P=20000,r=2,t=2,n=12,R,a;
    R=r/100;
    a=P*Math.pow(1+(R/n), n*t);
    System.out.println("total amount is" + a);
    System.out.println("compound1 is"+(a-P));
    }
    }

    ReplyDelete
  56. class area
    {
    public static void main(String xyz[])
    {
    int a =1,b =2,c =30;
    int s;
    s=(a+b+c)/2;
    double area=Math.sqrt(s*(s-a)*(s-b)*(s-c));
    System.out.println("area is"+s);
    }
    }

    ReplyDelete
  57. class add
    {
    public static void main(String ar[])
    {
    int a =100, b=9;

    while (a>0)
    {
    b++;
    a--;
    }
    System.out.println("add is"+b);

    }
    }

    ReplyDelete
Post a Comment