9:15 pm - Saturday April 20, 2019

Tag Archives: Object

Java Collections frequency example program

Here is a java example program for collections frequency operation in Collection c, Object o. The main function of this method is to get the frequency of an element present in the specified list of Collection. Here how to do java collections...

Vector Example Program for copyInto(Object[] anArray)

// Vector Example Program for copyInto(Object[] anArray) /** @author: candidjava.com @description: This program copies the content of the vector into the Array */ import java.util.*; public class CopyInto { public static void...

Vector Example Program for remove(Object o)

/** @author: candidjava @description: remove(Object o) is used to the element to be removed from this Vector, if present means return true otherwise return false. */ import java.util.*; public class RemoveVectorObj { public static...

Vector Example Program for lastIndexOf(Object o)

/** @AUTHOR: candid java @DESCRIPTION: coding for find the specific object index */ import java.util.Vector; public class LastIndexOf { public static void main(String[] args) { Vector v = new Vector(); //create a Vector...

Vector Example Program for addElement(E obj)

/** @AUTHOR:Candid java.com @DESCRIPTION: Adds the specified component to the end of this vector, increasing its size by one */ import java.util.Vector; public class AddElements { public static void main(String args[]) { Vector v...

ArrayList Example Program for get(int index)

/** *@author :CandidJava.com *@descriptions : This program explain the function and use of E get(int index).It is used get an element in specified index of arrayList */ import java.io.*; import java.util.*; public class ArrayListGet { public...

ArrayList Example Program for contains(Object o)

/** *@author :CandidJava.com *@descriptions : This program explain the function and use of boolean contains(Object o).It is used to check whether given element exist in the List or not */ import java.io.*; import java.util.*; public...

ArrayList Example Program for remove(Object o)

/** *@author :CandidJava.com *@descriptions : This program explain the function and use of remove(Object o).It is used to check whether first occurence of given element is removed from list or not */ import java.io.*; import java.util.*; public...

HashMap Example program for remove(Object key)

/** Author :candidjava.com Description: It removes a value of specific key from HashMap. */ import java.util.*; public class HashMapRemove { public static void main(String arg[]) { HashMap<Integer, String> osHashMap = new HashMap<Integer,...

String Example Program for equals(Object anObject)

/** @author: candidjava @description: to get 2 strings and use equals() method true if the String are equal; false otherwise. */ public class DeeEquals { public static void main(String []args) { String s1="candid";//declare...

Stack Example Program for remove(Object o)

/** *@author :CandidJava.com *@descriptions : This program explain the function and use of remove(Object o).It is used to check whether first occurence of given element is removed from stack or not */ import java.io.*; import java.util.*; ...

Stack Example Program for lastIndexOf(Object o)

/** *@author :CandidJava.com *@descriptions : This program explain the function and use of lastIndexOf(Object o).It is used to get index value for specfied element occurring at last */ import java.io.*; import java.util.*; public class...

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

Long Example Program for equals(Object obj)

/** *@author :CandidJava.com *@descriptions : This program explain the function and use of equals(Object obj) It is used to compare to objects that values given as long */ public class LongEqualsExample { public static void main(String...

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

StringBuilder Example Program for insert(int offset,Object obj)

/** *@author :CandidJava.com *@descriptions : This program explain the function and use of insert(int offset,Object obj) It is used to insert specified character sequence as per given index value. */ import java.lang.*; public class...

Boolean Example Program for equals(Object obj)

/** @author:candidjava.com @Description:explains how we use the equals(Object obj) */ public class EqualsExample { public static void main(String args[]) { Boolean a= false; Boolean b= true; boolean s=a.equals(b); //equals(Object...

Float Example program for equals(Object obj)

/** *@author :CandidJava.com *@descriptions : This program Compares this object against the specified object. The result is true if and only if the argument is not null and is a Float object that represents a float with the same value as...

Byte Example Program for equals(Object obj)

/** * @author :CandidJava.com * @descriptions : This program explain the function and use check whether one * byte is equal to another and return as Boolean */ class ByteValueEquals { public static void main(String...

Integer Example Program for equals(Object obj)

/** *@author :CandidJava.com *@descriptions : Basic Integer program using Equals(); */ import java.io.*; class EqualsEx { public static void main(String args[]) { Integer m = new Integer(200); // Object creation for integer...