JVM INTRODUCTION
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:-
1 ClassLoader SubSystem
1.1) Loading
1.2) Linking
1.3) Initialization
2 Memory Area
2.1) Method Area ----> Provide allocation to static method completely and address of the dynamic method. The method name is the address identifier of the method.
2.2) Heap Area ----> is used to create a memory for an object at runtime.
2.3) Stack Area -----> It is used to contain the address for Stack
2.4) PC-Register ----> It is used to perform arithmetic, logic, and other operations.
2.5) Native method Area:- It is used to contain Area for Other programming method code such as C and Cpp
3 Execution Engine
3.1) Interpreter:- it will read all byte code content line by line and prepare the outcome.
3.2) JIT or Runtime Compiler:- Convert Outcome of byte code to machine code
3.3) Garbage Collector:- Manage Automatic memory management
4 Native method interface & Library:- It will provide a data dictionary to the native code of java using the native library.
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?
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);
}
}
Post a Comment
If you have any doubt in programming or join online classes then you can contact us by comment .