Skip to Main Content
Java Programming by Pearson
book

Java Programming by Pearson

by Hari Mohan Pandey
May 2024
Intermediate to advanced content levelIntermediate to advanced
889 pages
37h 5m
English
Pearson India
Content preview from Java Programming by Pearson
The Collection Framework • 545
Explanation: In this program, a LinkedList instance LL1 is created and fi ve integer objects added at the
beginning of the LL1. A new LinkedList instance LL2 is then created from LL1. LL1 list is cleared using
clear method. The contains method is then made use of to check whether list LL2 contains 2 as object;
the method returns true. Next, the index of the object 2 is displayed. The program also demonstrates the
usage of set method for setting the value at specifi ed index. Note the addLast method is equivalent to
add method seen earlier. For adding element anywhere in the list, the methods add(index, object) form ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java Programming, 1st Edition by Pearson

Java Programming, 1st Edition by Pearson

K. Rajkumar
Object Oriented Programming Through Java by Pearson

Object Oriented Programming Through Java by Pearson

Ramesh Vasappanavara, Anand Vasappanavara, Gautam Vasappanavara
Python Programming by Pearson

Python Programming by Pearson

S.Sridhar, J. Indumathi, V.M. Hariharan

Publisher Resources

ISBN: 9781299486539