8:09 pm - Tuesday April 23, 2019

Tag Archives: Java Example

Java Example Program to calculate LCM

//Example Program to calculate LCM of two numbers /** * @author: candidjava.com * @description: calculate the LCM of two given numbers */ public class LCM { public static void main(String[] args) { int a = 36; int b = 92; int...

Math Example Program for expm1(double x)

//Math Example Program for expm1(double x) /** * @author:Candidjava.com * @description:calculate the expm1 of a double value */ import java.lang.*; public class ExponentExample { public static void main(String[] args) { double...

Math Example Program for cosh(double x)

//Math Example Program for cosh(double x) /** * @author:Candidjava.com * @description:calculate the hyperbolic cosine of a double value */ import java.lang.*; public class Cosh { public static void main(String[] args) { double...

Java Example Program to find curved Surface Area of Cylinder

//find curved Surface Area of Cylinder /** * @author:candidjava.com * @description:to find the curvedsurfaceArea of a cube by using the 'radius' * and 'height' values */ public class Cylinder { double radius; double...

Java Example Program to find surface Area Of Cube

//find surface Area Of Cube /** * @author:candidjava.com * @description:to find the surfaceArea of a cube by using the 'side' value */ public class Cube { int side; double surfaceArea; public void surfaceArea() // surface area...

Java Example Program to find volume Of Cube

//find volume Of Cube /** * @author:candidjava.com * @description:to find the volume of a cube by using the 'side' value */ public class Cube { int side; double volume; public void volume() // volume calculation { volume...

Java Example Program to find surface Area of Sphere

//find surface Area of Sphere /** * @author:candidjava.com * @description:to find the surfaceArea of a sphere by using the radius value */ public class Sphere { int radius; double surfaceArea; public void surfaceArea() // surface...

Double Example Program for valueOf(String s)

/** *Double Example Program for ValueOf() * @author: candidjava.com * @description: this method returns String representations of all data types valuess */ import java.lang.Double; public class ValueOf { public static void main(String...

Double Example Program for parseDouble(String s)

//Double Example Program for ParseDouble(String s) /** @author: candidjava.com @description:This method Returns a new double initialized to the value represented by the specified String ss */ import java.lang.Double; public class...

Character Example Program for getNumericValue(char ch)

// Example program for getNumericValue('ch') /** * @author :candidjava.com * @description:Returns the int value for the given character represents. */ public class Getnumeric1 { public static void main(String[] args) { char c...

Math Example Program for round(float a)

//sample program for round float value /** * @author: candidjava.com * @description:find rounded value for float */ public class Round { public static void main(String[] args) { float f1 = 6676.9f;// assign float value System.out.println("Math...

Math Example Program for copySign(double magnitude,double sign)

/** * @author: candidjava * @description: Math copySign(double magnitude, double sign) method. this * method is used to copy the sign in sign value to magnitude * value. */ public class CopySign { public...

StringBuilder Example Program for setLength(int newLength)

//sample program to find string length /** @author: candidjava.com @description:find length of given string using method length() */ import java.io.*; public class StringBuffer { public static void main(String args[]) { String...

java example program to find the area sphere

//java example program to find the area sphere /** * @author:candidjava.com * @description:to find the volume of a sphere by using the radius value */ public class Sphere { int radius; double volume; public void volume() //...

Java Example Program to find the Diameter of circle

//Java Example Program to find the Diameter of circle /** * @author:candidjava.com * @description:to find the diameter of a circle by using the radius */ class Circle { int radius; int diameter; public void diameter() // diameter...

Java Example Program to find circumference of circle

// Program for find a circumference of circle /** * @author:candidjava.com * @Description:find a circumference of circle to given number */ public class CircumCircle { public static void main(String args[]) { // Declare and initialize...

Java Example Program to find Area of Circle

//program name: area of circle /** * @ author:candid.com * @description:example to shows how to calculate the area of a circle using pi*r*r. */ public class Circle // Declaring class name as circle { public static void main(String...

Java Example Program to find the Transpose of matrix

//Example Program to find the Transpose of matrix /** * @author:candid java.com * @Descrption:check the matrix is Transpose or not */ public class Trans { public static void main(String args[]) { // initialize the variable int[][]...

Java example program to check whether the number is even or not

/** * @author:candidjava.com * @description:program to check whether the number is even or not */ public class Findeven { public static void main(String org[]) { int i = 14;// given a value to find even or odd if (i % 2 == 0)//...

Java Example Program to find whether a Given Matrix is Diagonal Matrix or not

//Example Program to find whether a Given Matrix is Diagonal Matrix or not /** * @author:Candidjava.com * @description:Check the given matrix is diagonal or not */ public class Diagonal { public static void main(String args[]) { //...