12:28 am - Tuesday October 24, 2017

LinkedList Example Program for size()

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044

/**
*LinkedList Example Program for size()
* @author   candidjava.com
* @description:  Returns the total number of elements present in this list.
*/
import java.util.*;

class Linkedlist {
public static void main(String[] args) {
LinkedList a = new LinkedList();// creats linkedlist object.
a.add("g");
a.add("f");// used for adding some elements in linkedlist.
a.add("s");
a.add("d");
a.add("c");
System.out.println("The size of the list is " + a.size());// it display
// the size
// of the
// linkedlist.
}
}

Output:
The size of the list is 5

BACK

Filed in: Z-A All Java Codes

Comments are closed.