SlideShare a Scribd company logo
import java.util.ArrayList;
public class ArrayListADT {
public static void printArray(ArrayList numsList, int numOfElem) {
int i = 0;
for (i = 0; i < numOfElem; ++i) {
System.out.print(numsList.get(i));
System.out.print(" ");
}
System.out.println("");
}
public static void main (String [] args) {
ArrayList numsList = new ArrayList();
int numOfElem = 4;
numsList.add(new Integer(101));
numsList.add(new Integer(200));
numsList.add(new Integer(103));
numsList.remove(1); //remove 200 at index 1 as index starts from 0
numsList.add(0,new Integer(100)); //add 100 at index 0 so 101 will move to index 1
numsList.add(2,new Integer(102)); // add 102 at index 2 so 103 will move down to
index 3
printArray(numsList, numOfElem);
return;
}
}
Output
Solution
import java.util.ArrayList;
public class ArrayListADT {
public static void printArray(ArrayList numsList, int numOfElem) {
int i = 0;
for (i = 0; i < numOfElem; ++i) {
System.out.print(numsList.get(i));
System.out.print(" ");
}
System.out.println("");
}
public static void main (String [] args) {
ArrayList numsList = new ArrayList();
int numOfElem = 4;
numsList.add(new Integer(101));
numsList.add(new Integer(200));
numsList.add(new Integer(103));
numsList.remove(1); //remove 200 at index 1 as index starts from 0
numsList.add(0,new Integer(100)); //add 100 at index 0 so 101 will move to index 1
numsList.add(2,new Integer(102)); // add 102 at index 2 so 103 will move down to
index 3
printArray(numsList, numOfElem);
return;
}
}
Output

More Related Content

Similar to import java.util.ArrayList;public class ArrayListADT {   public .pdf

ReverseList.javaimport java.util.ArrayList;public class Rever.pdf
 ReverseList.javaimport java.util.ArrayList;public class Rever.pdf ReverseList.javaimport java.util.ArrayList;public class Rever.pdf
ReverseList.javaimport java.util.ArrayList;public class Rever.pdf
aryan9007
 
Write a method called uniqueNumbers that takes an int array as param.pdf
Write a method called uniqueNumbers that takes an int array as param.pdfWrite a method called uniqueNumbers that takes an int array as param.pdf
Write a method called uniqueNumbers that takes an int array as param.pdf
fashioncollection2
 
I am stuck on parts E and FExercise 1      NumberListTester.java.pdf
I am stuck on parts E and FExercise 1      NumberListTester.java.pdfI am stuck on parts E and FExercise 1      NumberListTester.java.pdf
I am stuck on parts E and FExercise 1      NumberListTester.java.pdf
RAJATCHUGH12
 
Java programs - bubble sort, iterator, linked list, hash set, reverse string,...
Java programs - bubble sort, iterator, linked list, hash set, reverse string,...Java programs - bubble sort, iterator, linked list, hash set, reverse string,...
Java programs - bubble sort, iterator, linked list, hash set, reverse string,...Sunil Kumar Gunasekaran
 
Array list
Array listArray list
Array list
vishal choudhary
 
OrderTest.javapublic class OrderTest {       Get an arra.pdf
OrderTest.javapublic class OrderTest {         Get an arra.pdfOrderTest.javapublic class OrderTest {         Get an arra.pdf
OrderTest.javapublic class OrderTest {       Get an arra.pdf
akkhan101
 
sumOfSquaresimport java.util.;public class Arraylistoperation.pdf
sumOfSquaresimport java.util.;public class Arraylistoperation.pdfsumOfSquaresimport java.util.;public class Arraylistoperation.pdf
sumOfSquaresimport java.util.;public class Arraylistoperation.pdf
ankit482504
 
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdfLabprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
freddysarabia1
 
1. import java.util.Scanner; public class Alphabetical_Order {.pdf
1. import java.util.Scanner; public class Alphabetical_Order {.pdf1. import java.util.Scanner; public class Alphabetical_Order {.pdf
1. import java.util.Scanner; public class Alphabetical_Order {.pdf
Ankitchhabra28
 
Why following sort does not work (It does not sort last 2 - 3 numbe.pdf
Why following sort does not work (It does not sort last 2 - 3 numbe.pdfWhy following sort does not work (It does not sort last 2 - 3 numbe.pdf
Why following sort does not work (It does not sort last 2 - 3 numbe.pdf
gopalk44
 
import java.util.; public class ClientMerge_2 {     static Scan.pdf
import java.util.; public class ClientMerge_2 {     static Scan.pdfimport java.util.; public class ClientMerge_2 {     static Scan.pdf
import java.util.; public class ClientMerge_2 {     static Scan.pdf
premkhatri99
 
Please create the appropriate JUnit test cases to thoroughly.pdf
Please create the appropriate JUnit test cases to thoroughly.pdfPlease create the appropriate JUnit test cases to thoroughly.pdf
Please create the appropriate JUnit test cases to thoroughly.pdf
kitty811
 
Programming Java - Lection 07 - Puzzlers - Lavrentyev Fedor
Programming Java - Lection 07 - Puzzlers - Lavrentyev FedorProgramming Java - Lection 07 - Puzzlers - Lavrentyev Fedor
Programming Java - Lection 07 - Puzzlers - Lavrentyev Fedor
Fedor Lavrentyev
 
ArrayTest.java import java.util.Arrays; import java.util.Scann.pdf
ArrayTest.java import java.util.Arrays; import java.util.Scann.pdfArrayTest.java import java.util.Arrays; import java.util.Scann.pdf
ArrayTest.java import java.util.Arrays; import java.util.Scann.pdf
deepua8
 
2.(Sorted list array implementation)This sorted list ADT discussed .pdf
2.(Sorted list array implementation)This sorted list ADT discussed .pdf2.(Sorted list array implementation)This sorted list ADT discussed .pdf
2.(Sorted list array implementation)This sorted list ADT discussed .pdf
arshin9
 
import java-util--- public class MyLinkedList{ public static void.pdf
import java-util---  public class MyLinkedList{    public static void.pdfimport java-util---  public class MyLinkedList{    public static void.pdf
import java-util--- public class MyLinkedList{ public static void.pdf
asarudheen07
 
I need help creating a parametized JUnit test case for the following.pdf
I need help creating a parametized JUnit test case for the following.pdfI need help creating a parametized JUnit test case for the following.pdf
I need help creating a parametized JUnit test case for the following.pdf
fonecomp
 
WAP to store 10 numbers in an array and find out the largest and the smallest...
WAP to store 10 numbers in an array and find out the largest and the smallest...WAP to store 10 numbers in an array and find out the largest and the smallest...
WAP to store 10 numbers in an array and find out the largest and the smallest...
One97 Communications Limited
 
Write a method countUnique that takes a List of integers as a parame.pdf
Write a method countUnique that takes a List of integers as a parame.pdfWrite a method countUnique that takes a List of integers as a parame.pdf
Write a method countUnique that takes a List of integers as a parame.pdf
MALASADHNANI
 

Similar to import java.util.ArrayList;public class ArrayListADT {   public .pdf (20)

ReverseList.javaimport java.util.ArrayList;public class Rever.pdf
 ReverseList.javaimport java.util.ArrayList;public class Rever.pdf ReverseList.javaimport java.util.ArrayList;public class Rever.pdf
ReverseList.javaimport java.util.ArrayList;public class Rever.pdf
 
Write a method called uniqueNumbers that takes an int array as param.pdf
Write a method called uniqueNumbers that takes an int array as param.pdfWrite a method called uniqueNumbers that takes an int array as param.pdf
Write a method called uniqueNumbers that takes an int array as param.pdf
 
I am stuck on parts E and FExercise 1      NumberListTester.java.pdf
I am stuck on parts E and FExercise 1      NumberListTester.java.pdfI am stuck on parts E and FExercise 1      NumberListTester.java.pdf
I am stuck on parts E and FExercise 1      NumberListTester.java.pdf
 
Java programs - bubble sort, iterator, linked list, hash set, reverse string,...
Java programs - bubble sort, iterator, linked list, hash set, reverse string,...Java programs - bubble sort, iterator, linked list, hash set, reverse string,...
Java programs - bubble sort, iterator, linked list, hash set, reverse string,...
 
Array list
Array listArray list
Array list
 
Oop lecture7
Oop lecture7Oop lecture7
Oop lecture7
 
OrderTest.javapublic class OrderTest {       Get an arra.pdf
OrderTest.javapublic class OrderTest {         Get an arra.pdfOrderTest.javapublic class OrderTest {         Get an arra.pdf
OrderTest.javapublic class OrderTest {       Get an arra.pdf
 
sumOfSquaresimport java.util.;public class Arraylistoperation.pdf
sumOfSquaresimport java.util.;public class Arraylistoperation.pdfsumOfSquaresimport java.util.;public class Arraylistoperation.pdf
sumOfSquaresimport java.util.;public class Arraylistoperation.pdf
 
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdfLabprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
 
1. import java.util.Scanner; public class Alphabetical_Order {.pdf
1. import java.util.Scanner; public class Alphabetical_Order {.pdf1. import java.util.Scanner; public class Alphabetical_Order {.pdf
1. import java.util.Scanner; public class Alphabetical_Order {.pdf
 
Why following sort does not work (It does not sort last 2 - 3 numbe.pdf
Why following sort does not work (It does not sort last 2 - 3 numbe.pdfWhy following sort does not work (It does not sort last 2 - 3 numbe.pdf
Why following sort does not work (It does not sort last 2 - 3 numbe.pdf
 
import java.util.; public class ClientMerge_2 {     static Scan.pdf
import java.util.; public class ClientMerge_2 {     static Scan.pdfimport java.util.; public class ClientMerge_2 {     static Scan.pdf
import java.util.; public class ClientMerge_2 {     static Scan.pdf
 
Please create the appropriate JUnit test cases to thoroughly.pdf
Please create the appropriate JUnit test cases to thoroughly.pdfPlease create the appropriate JUnit test cases to thoroughly.pdf
Please create the appropriate JUnit test cases to thoroughly.pdf
 
Programming Java - Lection 07 - Puzzlers - Lavrentyev Fedor
Programming Java - Lection 07 - Puzzlers - Lavrentyev FedorProgramming Java - Lection 07 - Puzzlers - Lavrentyev Fedor
Programming Java - Lection 07 - Puzzlers - Lavrentyev Fedor
 
ArrayTest.java import java.util.Arrays; import java.util.Scann.pdf
ArrayTest.java import java.util.Arrays; import java.util.Scann.pdfArrayTest.java import java.util.Arrays; import java.util.Scann.pdf
ArrayTest.java import java.util.Arrays; import java.util.Scann.pdf
 
2.(Sorted list array implementation)This sorted list ADT discussed .pdf
2.(Sorted list array implementation)This sorted list ADT discussed .pdf2.(Sorted list array implementation)This sorted list ADT discussed .pdf
2.(Sorted list array implementation)This sorted list ADT discussed .pdf
 
import java-util--- public class MyLinkedList{ public static void.pdf
import java-util---  public class MyLinkedList{    public static void.pdfimport java-util---  public class MyLinkedList{    public static void.pdf
import java-util--- public class MyLinkedList{ public static void.pdf
 
I need help creating a parametized JUnit test case for the following.pdf
I need help creating a parametized JUnit test case for the following.pdfI need help creating a parametized JUnit test case for the following.pdf
I need help creating a parametized JUnit test case for the following.pdf
 
WAP to store 10 numbers in an array and find out the largest and the smallest...
WAP to store 10 numbers in an array and find out the largest and the smallest...WAP to store 10 numbers in an array and find out the largest and the smallest...
WAP to store 10 numbers in an array and find out the largest and the smallest...
 
Write a method countUnique that takes a List of integers as a parame.pdf
Write a method countUnique that takes a List of integers as a parame.pdfWrite a method countUnique that takes a List of integers as a parame.pdf
Write a method countUnique that takes a List of integers as a parame.pdf
 

More from mohammadirfan136964

2. Ligamentum arteriosumThe aortic arch loops over the left pulmo.pdf
2. Ligamentum arteriosumThe aortic arch loops over the left pulmo.pdf2. Ligamentum arteriosumThe aortic arch loops over the left pulmo.pdf
2. Ligamentum arteriosumThe aortic arch loops over the left pulmo.pdf
mohammadirfan136964
 
moles should be equal to complete consumption so.pdf
                     moles should be equal to complete consumption  so.pdf                     moles should be equal to complete consumption  so.pdf
moles should be equal to complete consumption so.pdf
mohammadirfan136964
 
TrueOne of the fundamental rules which control the PLSS system is .pdf
TrueOne of the fundamental rules which control the PLSS system is .pdfTrueOne of the fundamental rules which control the PLSS system is .pdf
TrueOne of the fundamental rules which control the PLSS system is .pdf
mohammadirfan136964
 
The stronger the attractions betweenparticles (mo.pdf
                     The stronger the attractions betweenparticles (mo.pdf                     The stronger the attractions betweenparticles (mo.pdf
The stronger the attractions betweenparticles (mo.pdf
mohammadirfan136964
 
a. It gives benzalacetone b. acetone will underg.pdf
                     a. It gives benzalacetone  b. acetone will underg.pdf                     a. It gives benzalacetone  b. acetone will underg.pdf
a. It gives benzalacetone b. acetone will underg.pdf
mohammadirfan136964
 
what is the mean, median, mode and the midrange for 191, 167,257,1.pdf
what is the mean, median, mode and the midrange for  191, 167,257,1.pdfwhat is the mean, median, mode and the midrange for  191, 167,257,1.pdf
what is the mean, median, mode and the midrange for 191, 167,257,1.pdf
mohammadirfan136964
 
Disodium malonate is an ionic sodium salt that is soluble in water..pdf
Disodium malonate is an ionic sodium salt that is soluble in water..pdfDisodium malonate is an ionic sodium salt that is soluble in water..pdf
Disodium malonate is an ionic sodium salt that is soluble in water..pdf
mohammadirfan136964
 
They showed that GFP protein could be expressed in the organisms wit.pdf
They showed that GFP protein could be expressed in the organisms wit.pdfThey showed that GFP protein could be expressed in the organisms wit.pdf
They showed that GFP protein could be expressed in the organisms wit.pdf
mohammadirfan136964
 
Thepossible mechanism by which a 75kD nuclear protein is imported in.pdf
Thepossible mechanism by which a 75kD nuclear protein is imported in.pdfThepossible mechanism by which a 75kD nuclear protein is imported in.pdf
Thepossible mechanism by which a 75kD nuclear protein is imported in.pdf
mohammadirfan136964
 
The neurons are nervous cells which play the central role in generat.pdf
The neurons are nervous cells which play the central role in generat.pdfThe neurons are nervous cells which play the central role in generat.pdf
The neurons are nervous cells which play the central role in generat.pdf
mohammadirfan136964
 
The parts of the respiratory tract which have nonkeratinized stratif.pdf
The parts of the respiratory tract which have nonkeratinized stratif.pdfThe parts of the respiratory tract which have nonkeratinized stratif.pdf
The parts of the respiratory tract which have nonkeratinized stratif.pdf
mohammadirfan136964
 
The impact of Brexit would be visible on the financial instituations.pdf
The impact of Brexit would be visible on the financial instituations.pdfThe impact of Brexit would be visible on the financial instituations.pdf
The impact of Brexit would be visible on the financial instituations.pdf
mohammadirfan136964
 
The alkaline earth metals burn in oxygen to form the monoxide, MO wh.pdf
The alkaline earth metals burn in oxygen to form the monoxide, MO wh.pdfThe alkaline earth metals burn in oxygen to form the monoxide, MO wh.pdf
The alkaline earth metals burn in oxygen to form the monoxide, MO wh.pdf
mohammadirfan136964
 
Squid molluscCrab ArthropodsCrayfish ArthropodsPolychaete .pdf
Squid molluscCrab ArthropodsCrayfish ArthropodsPolychaete .pdfSquid molluscCrab ArthropodsCrayfish ArthropodsPolychaete .pdf
Squid molluscCrab ArthropodsCrayfish ArthropodsPolychaete .pdf
mohammadirfan136964
 
The code you written is little bit confusing and lengthy. Here is th.pdf
The code you written is little bit confusing and lengthy. Here is th.pdfThe code you written is little bit confusing and lengthy. Here is th.pdf
The code you written is little bit confusing and lengthy. Here is th.pdf
mohammadirfan136964
 
Ques-1Normala flora and microbiota of nose and mouth are non-infe.pdf
Ques-1Normala flora and microbiota of nose and mouth are non-infe.pdfQues-1Normala flora and microbiota of nose and mouth are non-infe.pdf
Ques-1Normala flora and microbiota of nose and mouth are non-infe.pdf
mohammadirfan136964
 
Solution.According to IASB framework INCOME is the one of element .pdf
Solution.According to IASB framework INCOME is the one of element .pdfSolution.According to IASB framework INCOME is the one of element .pdf
Solution.According to IASB framework INCOME is the one of element .pdf
mohammadirfan136964
 
7. Answer is A.Cytochromes are protien containing iron or heme gro.pdf
7. Answer is A.Cytochromes are protien containing iron or heme gro.pdf7. Answer is A.Cytochromes are protien containing iron or heme gro.pdf
7. Answer is A.Cytochromes are protien containing iron or heme gro.pdf
mohammadirfan136964
 
A and C. RGB analog component video uses no compression, imposes no .pdf
A and C. RGB analog component video uses no compression, imposes no .pdfA and C. RGB analog component video uses no compression, imposes no .pdf
A and C. RGB analog component video uses no compression, imposes no .pdf
mohammadirfan136964
 
Public key authentication is the most secure colution and utilizes a.pdf
Public key authentication is the most secure colution and utilizes a.pdfPublic key authentication is the most secure colution and utilizes a.pdf
Public key authentication is the most secure colution and utilizes a.pdf
mohammadirfan136964
 

More from mohammadirfan136964 (20)

2. Ligamentum arteriosumThe aortic arch loops over the left pulmo.pdf
2. Ligamentum arteriosumThe aortic arch loops over the left pulmo.pdf2. Ligamentum arteriosumThe aortic arch loops over the left pulmo.pdf
2. Ligamentum arteriosumThe aortic arch loops over the left pulmo.pdf
 
moles should be equal to complete consumption so.pdf
                     moles should be equal to complete consumption  so.pdf                     moles should be equal to complete consumption  so.pdf
moles should be equal to complete consumption so.pdf
 
TrueOne of the fundamental rules which control the PLSS system is .pdf
TrueOne of the fundamental rules which control the PLSS system is .pdfTrueOne of the fundamental rules which control the PLSS system is .pdf
TrueOne of the fundamental rules which control the PLSS system is .pdf
 
The stronger the attractions betweenparticles (mo.pdf
                     The stronger the attractions betweenparticles (mo.pdf                     The stronger the attractions betweenparticles (mo.pdf
The stronger the attractions betweenparticles (mo.pdf
 
a. It gives benzalacetone b. acetone will underg.pdf
                     a. It gives benzalacetone  b. acetone will underg.pdf                     a. It gives benzalacetone  b. acetone will underg.pdf
a. It gives benzalacetone b. acetone will underg.pdf
 
what is the mean, median, mode and the midrange for 191, 167,257,1.pdf
what is the mean, median, mode and the midrange for  191, 167,257,1.pdfwhat is the mean, median, mode and the midrange for  191, 167,257,1.pdf
what is the mean, median, mode and the midrange for 191, 167,257,1.pdf
 
Disodium malonate is an ionic sodium salt that is soluble in water..pdf
Disodium malonate is an ionic sodium salt that is soluble in water..pdfDisodium malonate is an ionic sodium salt that is soluble in water..pdf
Disodium malonate is an ionic sodium salt that is soluble in water..pdf
 
They showed that GFP protein could be expressed in the organisms wit.pdf
They showed that GFP protein could be expressed in the organisms wit.pdfThey showed that GFP protein could be expressed in the organisms wit.pdf
They showed that GFP protein could be expressed in the organisms wit.pdf
 
Thepossible mechanism by which a 75kD nuclear protein is imported in.pdf
Thepossible mechanism by which a 75kD nuclear protein is imported in.pdfThepossible mechanism by which a 75kD nuclear protein is imported in.pdf
Thepossible mechanism by which a 75kD nuclear protein is imported in.pdf
 
The neurons are nervous cells which play the central role in generat.pdf
The neurons are nervous cells which play the central role in generat.pdfThe neurons are nervous cells which play the central role in generat.pdf
The neurons are nervous cells which play the central role in generat.pdf
 
The parts of the respiratory tract which have nonkeratinized stratif.pdf
The parts of the respiratory tract which have nonkeratinized stratif.pdfThe parts of the respiratory tract which have nonkeratinized stratif.pdf
The parts of the respiratory tract which have nonkeratinized stratif.pdf
 
The impact of Brexit would be visible on the financial instituations.pdf
The impact of Brexit would be visible on the financial instituations.pdfThe impact of Brexit would be visible on the financial instituations.pdf
The impact of Brexit would be visible on the financial instituations.pdf
 
The alkaline earth metals burn in oxygen to form the monoxide, MO wh.pdf
The alkaline earth metals burn in oxygen to form the monoxide, MO wh.pdfThe alkaline earth metals burn in oxygen to form the monoxide, MO wh.pdf
The alkaline earth metals burn in oxygen to form the monoxide, MO wh.pdf
 
Squid molluscCrab ArthropodsCrayfish ArthropodsPolychaete .pdf
Squid molluscCrab ArthropodsCrayfish ArthropodsPolychaete .pdfSquid molluscCrab ArthropodsCrayfish ArthropodsPolychaete .pdf
Squid molluscCrab ArthropodsCrayfish ArthropodsPolychaete .pdf
 
The code you written is little bit confusing and lengthy. Here is th.pdf
The code you written is little bit confusing and lengthy. Here is th.pdfThe code you written is little bit confusing and lengthy. Here is th.pdf
The code you written is little bit confusing and lengthy. Here is th.pdf
 
Ques-1Normala flora and microbiota of nose and mouth are non-infe.pdf
Ques-1Normala flora and microbiota of nose and mouth are non-infe.pdfQues-1Normala flora and microbiota of nose and mouth are non-infe.pdf
Ques-1Normala flora and microbiota of nose and mouth are non-infe.pdf
 
Solution.According to IASB framework INCOME is the one of element .pdf
Solution.According to IASB framework INCOME is the one of element .pdfSolution.According to IASB framework INCOME is the one of element .pdf
Solution.According to IASB framework INCOME is the one of element .pdf
 
7. Answer is A.Cytochromes are protien containing iron or heme gro.pdf
7. Answer is A.Cytochromes are protien containing iron or heme gro.pdf7. Answer is A.Cytochromes are protien containing iron or heme gro.pdf
7. Answer is A.Cytochromes are protien containing iron or heme gro.pdf
 
A and C. RGB analog component video uses no compression, imposes no .pdf
A and C. RGB analog component video uses no compression, imposes no .pdfA and C. RGB analog component video uses no compression, imposes no .pdf
A and C. RGB analog component video uses no compression, imposes no .pdf
 
Public key authentication is the most secure colution and utilizes a.pdf
Public key authentication is the most secure colution and utilizes a.pdfPublic key authentication is the most secure colution and utilizes a.pdf
Public key authentication is the most secure colution and utilizes a.pdf
 

Recently uploaded

Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
Kartik Tiwari
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
ArianaBusciglio
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 

Recently uploaded (20)

Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 

import java.util.ArrayList;public class ArrayListADT {   public .pdf

  • 1. import java.util.ArrayList; public class ArrayListADT { public static void printArray(ArrayList numsList, int numOfElem) { int i = 0; for (i = 0; i < numOfElem; ++i) { System.out.print(numsList.get(i)); System.out.print(" "); } System.out.println(""); } public static void main (String [] args) { ArrayList numsList = new ArrayList(); int numOfElem = 4; numsList.add(new Integer(101)); numsList.add(new Integer(200)); numsList.add(new Integer(103)); numsList.remove(1); //remove 200 at index 1 as index starts from 0 numsList.add(0,new Integer(100)); //add 100 at index 0 so 101 will move to index 1 numsList.add(2,new Integer(102)); // add 102 at index 2 so 103 will move down to index 3 printArray(numsList, numOfElem); return; } } Output Solution import java.util.ArrayList; public class ArrayListADT { public static void printArray(ArrayList numsList, int numOfElem) { int i = 0;
  • 2. for (i = 0; i < numOfElem; ++i) { System.out.print(numsList.get(i)); System.out.print(" "); } System.out.println(""); } public static void main (String [] args) { ArrayList numsList = new ArrayList(); int numOfElem = 4; numsList.add(new Integer(101)); numsList.add(new Integer(200)); numsList.add(new Integer(103)); numsList.remove(1); //remove 200 at index 1 as index starts from 0 numsList.add(0,new Integer(100)); //add 100 at index 0 so 101 will move to index 1 numsList.add(2,new Integer(102)); // add 102 at index 2 so 103 will move down to index 3 printArray(numsList, numOfElem); return; } } Output