10:08 pm - Monday May 21, 2018

LinkedList Example Program for addLast(E e)

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
/**
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 args[]) throws IOException {
		int b = 2;
		LinkedList l = new LinkedList();
		l.addLast(b);// to append 2 to the list in last position
		System.out.println(b + "is added as a Last element in the list");
	}
}


Output
2 is added as a Last element in the list

Filed in: Z-A All Java Codes

Comments are closed.