12:10 am - Tuesday May 22, 2018

Tag Archives: example program

Character Example Program for codePointAt(char[] a,int index, int limit)

/** @Author:Candid @discription:To find codePointAt **/ import java.lang.*; public class Character1 { public static void main(String args[]) { char a[] = { 'a', 'b', 'c', 'd', 'e' }; // Initialize the array System.out.println(a); Character...

Math Example Program for sinh(double x)

/* Math Example Program for sinh(double x)*/ /** *@Author:CandidJava.com *@Description:example math program to find sinh value */ public class Sinh { public static void main(String args[]) { double x = 180;// initialize the variable double...

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[][]...

Hashtable Example program for contains(Object value)

/** Author :candidjava.com Description: Tests if some key maps into the specified value in this hashtable */ import java.util.*; import java.util.Hashtable; import java.io.IOException; public class HashtableContainsExample { public...

LinkedList Example Program for indexOf(Object o)

/** Author :candidjava.com Description: Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element. */ import java.io.IOException; import java.util.*; public class...

LinkedList Example Program for get(int index)

/** Author :candidjava.com Description: Returns the element at the specified position in this list. */ import java.io.IOException; import java.util.*; public class LinkedListGetExample { public static void main(String args[]) { int...

LinkedList Example Program for descendingIterator()

/** Author :candidjava.com Description: It Returns an iterator over the elements in this deque in reverse sequential order. The elements will be returned in order from last (tail) to first (head). */ import java.io.IOException; import...

LinkedList Example Program for contains(Object o)

/** Author :candidjava.com Description: It will return the hashcode value of the object which we creates. */ import java.io.IOException; import java.util.*; public class LinkedListContainExample { public static void main(String...

LinkedList Example Program for clear()

/** Author :candidjava.com Description: To calculate the current capacity of the string by using capacity() method it returns the current capacity of the String */ import java.io.IOException; import java.util.*; import java.io.IOException; public...

LinkedList Example Program for addLast(E e)

/** Author :candidjava.com Description: Appends the specified element to the end of this list. */ import java.io.IOException; import java.util.*; import java.io.IOException; public class LinkedlistAddLast { public static void main(String...

LinkedList Example Program for addFirst(E e)

/** Author :candidjava.com Description: To Inserts the specified element at the beginning of this list. */ import java.io.IOException; import java.util.*; import java.io.IOException; public class LinkedListAddFirst { public static...

LinkedList Example Program for add(int index, E element)

/** Author :candidjava.com Description: Inserts the specified element at the specified position in this list. */ import java.io.IOException; import java.util.*; import java.io.IOException; public class LinkedlistAddExample2 { public...

Vector Example Program for removeElement(Object obj)

/** @author: candidjava @description: removeElement(Object obj) is used to Removes the first (lowest-indexed) occurrence of the argument from this vector.if the elements is removed means return true otherwise return false */ import java.util.*; public...

Vector Example Program for removeAllElements()

/** @author: candidjava @description: removeAllElements() is used to Removes all components from this vector and sets its size to zero. */ import java.util.*; public class DeeVectorRemoveAllElements { public static void main(String[]...

Java Example Program to convert positive number to negative

/* java example program to convert -ve number to +ve number */ /** * @author:candidjava.com * @description: here, we are using Math.abs function to convert -ve number to * +ve number */ public class Convert { public...

Java Example Program to find Second Largest Number

/* Find Second Largest Nunber */ /** * @author:Candidjava.com * @Description:Find the second Largest Number */ public class FindsecLarg { public static void main(String[] args) { // intialize the array values int arr[] = {...

Java Example Program using while Loop

/*program for While Loop statement*/ /** * @author:candidjava.com * @description:Print the counts the number usinr while loop */ public class WhileLoopExample { public static void main(String args[]) { // initialize a variable int...

Java Example Program using for loop

/*program for for statements*/ /** * @author:candidjava.com * @description:Print the triangle values using for loop */ public class ForLoopExample { public static void main(String args[]) { // declare the variables int i, j; //...

Java Example Program using IF statement

/* Program for if statement */ /** * @author:Candidjava.com * @Description:Find the charges for current units using if statement */ public class Units { public static void main(String args[]) { int i = 1003, u; // check the...

ArrayList Example Program for addAll(Collection c)

/** @Author:candidjava.com @Description:Adding other collection elements to ArrayList */ import java.util.ArrayList; import java.util.Vector; public class ArrayListAddAll { public static void main(String args[]) { ArrayList al...