11:13 pm - Saturday May 27, 2017

LinkedList Example Program for push(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
*@description: LinkedList Example Program for push(E e)
*/
import java.util.LinkedList;
public class Push
{
public static void main(String[] args)
{
// create a LinkedList
LinkedList list = new LinkedList();
// add some elements
list.add("task");
list.add(27);
list.add("query");
list.add("100");
// print the list
System.out.println("LinkedList:" + list);
// push Elements the list
list.push("java is a platform Independent");
list.push("api");
list.push("java");
list.push("array");
// print the list
System.out.println("LinkedList:" + list);
}
}

Output:

LinkedList:[task, 27, query ,100]
LinkedList:[array,java,api,java is a platform Independent,task,27,query,100]

 

BACK

Filed in: Z-A All Java Codes

Comments are closed.