3:54 am - Monday February 20, 2017

Archive: Core Java Tutorial Subscribe to Core Java Tutorial

New updates in jdk 1.8

Java Programming Language Lambda Expressions, a new language feature, has been introduced in this release. They enable you to treat functionality as a method argument, or code as data. Lambda expressions let you express instances of single-method...

IS-A HAS-A Relationship in Java

IS-A HAS-A Relationship IS-A refers to inheritance or implementation. IS-A is expressed with the keyword extends. HAS-A means instance of a class, member variable that can  be accessed by an object can be expressed as has a relationship...

StringBuilder Example Program for offsetByCodePoints(int index,int codePointOffset)

/** *@author:candidjava.com *@description:StringBuilder Example Program for offsetByCodePoints(int index,int codePointOffset) */ class Offsetbyte { public static void main(String[] args) { String s="offset by code points"; //check...

Math Example Program for log1p(double x)

/** @Author:Candid @description:Math Example program for loglp(double x) */ public class Math { public static void main(String args[]) { double x=4; //declare value in double double y=StrictMath.log1p(x); //assign...

Math Example Program for getExponent(float f)

//Math Example program for getExponent(Float f) /** @author:candidjava.com @Description:Returns the exponent used in the representation of a float */ public class getExpo { public static void main(String[] args) { //initialize...

Math Example Program for exp(double a)

//Example program for Exponent /** @author:candidjava.com @Description:program for exponent using exp() method */ public class expo { public static void main(String args[]) { //initialize a double value double a=1.0; //print the...

Hashtable Example program for equals(Object o)

/** Author :candidjava.com Description: Compares the specified Object with this Map for equality, as per the definition in the Map interface /* import java.util.*; import java.util.Hashtable; import java.io.IOException; public class...

Hashtable Example program for entrySet()

/** Author :candidjava.com Description: Returns a Set view of the entries contained in this Hashtable */ import java.util.*; import java.util.Hashtable; import java.io.IOException; public class HashtableEntrySetExample { public static...

Hashtable Example program for elements()

/** Author :candidjava.com Description: Returns an enumeration of the values in this hashtable. */ import java.util.*; import java.util.Hashtable; import java.io.IOException; public class HashtableElementsExample { public static void...

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

Hashtable Example program for clear()

/** Author :candidjava.com Description: Clears this hashtable so that it contains no keys. */ import java.util.*; import java.util.Hashtable; import java.io.IOException; public class HashtableClearExample { public static void main(String...

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 getLast()

/** Author :candidjava.com Description: Returns the Last element in the list. */ import java.io.IOException; import java.util.*; public class LinkedListGetLast { public static void main(String args[]) { int b=60,c=20,d=30; LinkedList...

LinkedList Example Program for getFirst()

/** Author :candidjava.com Description: Returns the first element in the list. */ import java.io.IOException; import java.util.*; public class LinkedListGetFirst { public static void main(String args[]) { int b=60,c=20,d=30; LinkedList...

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

HashTable example programs

Hashtable Example program using Get Size()  _______________________________________________________________________________________________ Hashtable example program using iterate() _______________________________________________________________________________________________________________________________________________________________ Hashtable...

Core Java Tutorial