7:49 pm - Thursday April 25, 2019

Tag Archives: Sample Program

Date in java example program for compareTo(Object o)

/** *@author: Candidjava *@description: Date in java example for compateTo(Object o) */ import java.util.Date; public class Compare1 { public static void main(String[] args) { Date d1 = new Date(); try { Thread.sleep(10); }...

ArrayList Example Program for toArray(T[] a)

/** @AUTHOR:candidjava.com @DESCRIPTION:returning the array elements in the proper sequence by copying the elements of the arraylist to the object element. **/ import java.util.*; public class ToArray { public static void main(String...

HashMap Example program for containsKey(Object key)

/** @AUTHOR:candidjava.com @DESCRIPTION:checking the hash table that specific key is available or not */ import java.util.*; public class ContainsKey { public static void main(String args[]) { HashMap hm=new HashMap(); ...

Java Example Program to find the Biggest among two numbers

/*program to find the biggest among two numbers */ /** @author:candidjava.com @description:program to find the biggest among two numbers */ public class Biggest { public static void main(String args[]) { int a=50; int b=92; if(a>b) { System.out.print("a...

Java Example Program to exaplain Switch case statement

/*java example program to explain switch case statement */ /** @author:candidjava.com @description:java example program to explain switch case statement */ public class SwitchCase { public static void main(String args[]) { int...

Java Example Program to Calculate Electricity Bill

/*java example program to calculate electricity bills */ /** @author:candidjava.com @description:java example program to calculate electricity bills */ public class ElectricityBill { public static void main(String args[]) { int...

String Example Program for isEmpty()

/** @AUTHOR: candid java @DESCRIPTION: checking the given string is empty or not */ public class IsEmpty { public static void main(String args[]) { String str1="hello java"; String str2=""; ...

Stack Example Program for copyInto(Object[] anArray)

/** *@author :CandidJava.com *@descriptions : This program explain the function and use of copyInto(Object[] anarray) */ import java.io.*; import java.util.*; public class StackCopy { public static void main(String args[]) { Stack...

Short Example Program for equals(Object obj)

/** Author :candidjava.com Description: Program using SHORT equals () method */ public class Equals { public static void main(String args[]) throws Exception { short s1=34; short s2=34; Short t=new Short(s1); Short r=new Short(s2); boolean...

Short Example Program for doubleValue()

/** Author :candidjava.com Description: Program using SHORT DoubleValue () method */ public class DoubleValue { public static void main(String args[]) { short s=34; Short t=new Short(s); double d=t.doubleValue(); // Returns...

Sample JDBC program using Oracle

Float Example Programs

Float Example program for compare(float f1, float f2)  _______________________________________________________________________________________________________ Float Example program for byteValue() _______________________________________________________________________________________________________ Float...

Boolean Example Programs

Boolean Example Program for compareTo(Boolean b)  ________________________________________________________________________________________________________ Boolean Example Program for parseBoolean(String s)  ________________________________________________________________________________________________________ Boolean...

Integer Example Program for shortValue()

/** *@author :candidjava.com *@descriptions : First Check with Short datatype range, */ public class ShortValueExample { public static void main(String[] args) { Integer a=35000; Integer d = new Integer(35000);...

Integer Example Program for byteValue()

/** * @author :CandidJava.com * @descriptions : This program returns the byte value of a given number */ public class ByteValueEx { public static void main(String args[]) { Integer j = new Integer(1101); // Creating Objects for...

Integer Example Programs

Integer Example Program for bitCount(int i) _____________________________________________________________________________________________________ Integer Example Program for byteValue() _____________________________________________________________________________________________________ Integer...

LinkedHashSet Example programs

LinkedHashSet example program for add() method _______________________________________________________________________________________________________ LinkedHashSet example program for add() and remove()  _______________________________________________________________________________________________________...

HashMap Example programs

HashMap example  program to check if a particular key exists using containskey() ________________________________________________________________________________________________________ HashMap Example for Get Size() ________________________________________________________________________________________________________ HashMap...

LinkedHashMap Example programs

LinkedHashMap Example  program for Get Size()  ___________________________________________________________________________________________ LinkedHashMap example program by using  generic () method ___________________________________________________________________________________________ LinkedHashMap...