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:-
ASSIGNMENTS on Java:-
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?
class I2F
ReplyDelete{
public static void main(String arg[])
{
float inch=1000;
float feet=inch/12;
System.out.println(feet);
}
}
class CM2M
ReplyDelete{
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");
}
}
class Sc
ReplyDelete{
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);
}
}
class H2A
ReplyDelete{
public static void main(String arg[])
{
int h=41;
double a= h*2.471;
System.out.println(a);
}
}
H
ReplyDeletenitesh bamotriya
ReplyDeletepublic 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);
}
}
Nitesh bamotriya
ReplyDeletepublic 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);
}
}
nitesh bamotriya
ReplyDeletepublic class Main
{
public static void main(String[] args) {
int hect=23;
double acre=hect*2.471;
System.out.println("hecter to acre is"+acre);
}
}
Nitesh bamotriya
ReplyDeletepublic 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);
}
}
class cm2
ReplyDelete{
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);
}
}
class Sqcb
ReplyDelete{
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);
}
}
class hect
ReplyDelete{
public static void main(String args[])
{
int h=20;
double a=h*2.471;
System.out.println("A="+a);
}
}
class convert
ReplyDelete{
public static void main(String args[])
{
int inch=124,feet;
feet=inch/12;
System.out.println("feet="+feet);
}
}
package test;
ReplyDeleteimport 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);
}
}
class Convertor
ReplyDelete{
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);
}
}
import java.lang.Math;
ReplyDeleteclass 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);
}
}
import java.util.Scanner;
ReplyDeleteimport 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);
}
}
//inch to feet
ReplyDeleteclass InchFeet
{
public static void main(String arg[])
{
float inch=200;
float feet=inch/12;
System.out.println(feet);
}
}
import java.util.Scanner;
ReplyDeleteclass 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);
}
}
//cm to m
ReplyDeleteimport 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);
}
}
// WAP to convert feet to inch and inch to feet?
ReplyDeleteimport 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);
}
}
}
class Cmm
ReplyDelete{
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");
}
}
WAP to convert feet to inch and inch to feet?
ReplyDeleteimport 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);
}
}
WAP to convert cm to meter and meter to CM?
ReplyDeleteimport 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);
}
}
WAP to calculate compund interest?
ReplyDeleteimport 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);
}
}
WAP to calculate the square and cube of any assigned number?
ReplyDeleteimport 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);
}
}
WAP to calculate the square and cube of any assigned number?
ReplyDeleteimport 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);
}
}
WAP to convert hectare to acre?
ReplyDeleteimport 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);
}
}
class S2C
ReplyDelete{
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);
}
}
WAP to convert cm to meter and meter to CM?
ReplyDeleteclass 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);
}
}
WAP to convert hectare to acre?
ReplyDeleteclass H2A
{
public static void main(String[] args) {
int hect = 247;
double acr = hect*2.56;
System.out.println("hect to acr "+acr);
}
}
WAP to convert feet to inch and inch to feet?
ReplyDeleteclass 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);
}
}
WAP to calculate compund interest?
ReplyDeletelass 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));
}
}
WAP to calculate the square and cube of any assigned number?
ReplyDeleteProgram-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);
}
}
class FeettoInches
ReplyDelete{
public static void main(String args[]){
int feet=25;
float inch;
inch=12*feet;
System.out.println("feet to inches:"+inch);
}
}
Ankita Verma
ReplyDeleteclass 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);
}
}
Ankita Verma
ReplyDeleteclass 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);
}
}
Ankita Verma
ReplyDeleteclass 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);
}
}
Ankita Vema
ReplyDeleteclass 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);
}
}
ReplyDeleteimport 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);
}
}
import java.util.Scanner;
ReplyDeleteclass 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);
}
}
import java.util.Scanner;
ReplyDeletepublic 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);
}
}
import java.util.Scanner;
ReplyDeletepublic 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));
}
}
import java.util.Scanner;
ReplyDeletepublic 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);
}
}
//yogesh seroke
ReplyDeleteimport 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);
}
}
//yogesh seroke
ReplyDeleteimport 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);
}
}
//yogesh seroke
ReplyDeleteimport 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);
}
}
//yogesh seroke
ReplyDeleteimport 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);
}
}
//yogesh seroke
ReplyDeleteimport 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));
}
}
//yogesh seroke
ReplyDeleteimport 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);
}
}
Answer Of Feet To INCH:-
ReplyDeleteclass FtoI
{
public static void main(String args[])
{
float ft=12.5F,inch;
inch = 12*ft;
System.out.println(ft + "\'" + " to " + inch + "\"");
}
}
Calculate Compund Interest
ReplyDeleteclass 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));
}
}
WAP to convert feet into inches and inches into feet.
ReplyDeletepackage 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);
}
}
WAP to find compound interest.
ReplyDeletepackage 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);
}
}
WAP to calculate compound interest with user input.
ReplyDeletepackage 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);
}
}
class compound1
ReplyDelete{
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));
}
}
class area
ReplyDelete{
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);
}
}
class add
ReplyDelete{
public static void main(String ar[])
{
int a =100, b=9;
while (a>0)
{
b++;
a--;
}
System.out.println("add is"+b);
}
}