SlideShare a Scribd company logo
Hello, we are learning generics in Java and looking at lists specifically.
this is a method to add an item to a list.
I don't understand how the statement in bold is working. Can anyone please break it down for me
and explain how it works with the whole method? many thanks for considering my request.
public void add(T a) {
// if length of the list is equal to the size
// resize the list, then add the element
if (items.length == this.size) {
this.resize();
}
this.items[size] = a;
this.size++;
}

More Related Content

More from a2zmobiles

7- With the help of suitable examples- Explain how the application of.pdf
7- With the help of suitable examples- Explain how the application of.pdf7- With the help of suitable examples- Explain how the application of.pdf
7- With the help of suitable examples- Explain how the application of.pdf
a2zmobiles
 
7- A taxpayer's wife died in 2021 and he has not remarried- He has two.pdf
7- A taxpayer's wife died in 2021 and he has not remarried- He has two.pdf7- A taxpayer's wife died in 2021 and he has not remarried- He has two.pdf
7- A taxpayer's wife died in 2021 and he has not remarried- He has two.pdf
a2zmobiles
 
7- In his book- Alfred Wegener presented many lines of evidence that E.pdf
7- In his book- Alfred Wegener presented many lines of evidence that E.pdf7- In his book- Alfred Wegener presented many lines of evidence that E.pdf
7- In his book- Alfred Wegener presented many lines of evidence that E.pdf
a2zmobiles
 
7- In humans- the allele for normal blood clotting- H- is dominant to.pdf
7- In humans- the allele for normal blood clotting- H- is dominant to.pdf7- In humans- the allele for normal blood clotting- H- is dominant to.pdf
7- In humans- the allele for normal blood clotting- H- is dominant to.pdf
a2zmobiles
 
7- Examine the map of the Murky Mists Mountain- - D- INote tne strike.pdf
7- Examine the map of the Murky Mists Mountain- - D- INote tne strike.pdf7- Examine the map of the Murky Mists Mountain- - D- INote tne strike.pdf
7- Examine the map of the Murky Mists Mountain- - D- INote tne strike.pdf
a2zmobiles
 
7- 7- Caleulating Returns and Variability (LO1) Usine the followine re.pdf
7- 7- Caleulating Returns and Variability (LO1) Usine the followine re.pdf7- 7- Caleulating Returns and Variability (LO1) Usine the followine re.pdf
7- 7- Caleulating Returns and Variability (LO1) Usine the followine re.pdf
a2zmobiles
 
7- A perpetuity-immediate pays 1500 per year- Alice receives the first.pdf
7- A perpetuity-immediate pays 1500 per year- Alice receives the first.pdf7- A perpetuity-immediate pays 1500 per year- Alice receives the first.pdf
7- A perpetuity-immediate pays 1500 per year- Alice receives the first.pdf
a2zmobiles
 
7- A cohort study employs a- Subjects known at the start to have the d.pdf
7- A cohort study employs a- Subjects known at the start to have the d.pdf7- A cohort study employs a- Subjects known at the start to have the d.pdf
7- A cohort study employs a- Subjects known at the start to have the d.pdf
a2zmobiles
 
7- When I present the German Tank Problem- the most popular proposals.pdf
7- When I present the German Tank Problem- the most popular proposals.pdf7- When I present the German Tank Problem- the most popular proposals.pdf
7- When I present the German Tank Problem- the most popular proposals.pdf
a2zmobiles
 
7- (Microsoft Visual Basic) Display a triangle Hints- The following co.pdf
7- (Microsoft Visual Basic) Display a triangle Hints- The following co.pdf7- (Microsoft Visual Basic) Display a triangle Hints- The following co.pdf
7- (Microsoft Visual Basic) Display a triangle Hints- The following co.pdf
a2zmobiles
 
HELPPP Which of the following are differences in the recommendations.pdf
HELPPP   Which of the following are differences in the recommendations.pdfHELPPP   Which of the following are differences in the recommendations.pdf
HELPPP Which of the following are differences in the recommendations.pdf
a2zmobiles
 
Hemophilia is due to a recessive allele (h) linked to the X chromosome (1).pdf
Hemophilia is due to a recessive allele (h) linked to the X chromosome (1).pdfHemophilia is due to a recessive allele (h) linked to the X chromosome (1).pdf
Hemophilia is due to a recessive allele (h) linked to the X chromosome (1).pdf
a2zmobiles
 
Henry Ford- majority shareholder of the Ford Motor Company- announced.pdf
Henry Ford- majority shareholder of the Ford Motor Company- announced.pdfHenry Ford- majority shareholder of the Ford Motor Company- announced.pdf
Henry Ford- majority shareholder of the Ford Motor Company- announced.pdf
a2zmobiles
 
hen should a company use the fair value method to account for its equi.pdf
hen should a company use the fair value method to account for its equi.pdfhen should a company use the fair value method to account for its equi.pdf
hen should a company use the fair value method to account for its equi.pdf
a2zmobiles
 
HELPPPO A- B- What is the correct order of events that take plac.pdf
HELPPPO  A-    B-   What is the correct order of events that take plac.pdfHELPPPO  A-    B-   What is the correct order of events that take plac.pdf
HELPPPO A- B- What is the correct order of events that take plac.pdf
a2zmobiles
 
help please!thanks Ear Shape In pigs- erect ears are dominant (E) to d.pdf
help please!thanks Ear Shape In pigs- erect ears are dominant (E) to d.pdfhelp please!thanks Ear Shape In pigs- erect ears are dominant (E) to d.pdf
help please!thanks Ear Shape In pigs- erect ears are dominant (E) to d.pdf
a2zmobiles
 
HELP PLEASE A- B- What event is indicative of transcription init.pdf
HELP PLEASE  A-   B-    What event is indicative of transcription init.pdfHELP PLEASE  A-   B-    What event is indicative of transcription init.pdf
HELP PLEASE A- B- What event is indicative of transcription init.pdf
a2zmobiles
 
Help create the vcipher-h and vcipher-cc files for the vigenere cipher.pdf
Help create the vcipher-h and vcipher-cc files for the vigenere cipher.pdfHelp create the vcipher-h and vcipher-cc files for the vigenere cipher.pdf
Help create the vcipher-h and vcipher-cc files for the vigenere cipher.pdf
a2zmobiles
 
Help implement BST- The code must follow the instruction below as well.pdf
Help implement BST- The code must follow the instruction below as well.pdfHelp implement BST- The code must follow the instruction below as well.pdf
Help implement BST- The code must follow the instruction below as well.pdf
a2zmobiles
 
Help me create a use case diagram for this use case- Use case title-.pdf
Help me create a use case diagram for this use case-   Use case title-.pdfHelp me create a use case diagram for this use case-   Use case title-.pdf
Help me create a use case diagram for this use case- Use case title-.pdf
a2zmobiles
 

More from a2zmobiles (20)

7- With the help of suitable examples- Explain how the application of.pdf
7- With the help of suitable examples- Explain how the application of.pdf7- With the help of suitable examples- Explain how the application of.pdf
7- With the help of suitable examples- Explain how the application of.pdf
 
7- A taxpayer's wife died in 2021 and he has not remarried- He has two.pdf
7- A taxpayer's wife died in 2021 and he has not remarried- He has two.pdf7- A taxpayer's wife died in 2021 and he has not remarried- He has two.pdf
7- A taxpayer's wife died in 2021 and he has not remarried- He has two.pdf
 
7- In his book- Alfred Wegener presented many lines of evidence that E.pdf
7- In his book- Alfred Wegener presented many lines of evidence that E.pdf7- In his book- Alfred Wegener presented many lines of evidence that E.pdf
7- In his book- Alfred Wegener presented many lines of evidence that E.pdf
 
7- In humans- the allele for normal blood clotting- H- is dominant to.pdf
7- In humans- the allele for normal blood clotting- H- is dominant to.pdf7- In humans- the allele for normal blood clotting- H- is dominant to.pdf
7- In humans- the allele for normal blood clotting- H- is dominant to.pdf
 
7- Examine the map of the Murky Mists Mountain- - D- INote tne strike.pdf
7- Examine the map of the Murky Mists Mountain- - D- INote tne strike.pdf7- Examine the map of the Murky Mists Mountain- - D- INote tne strike.pdf
7- Examine the map of the Murky Mists Mountain- - D- INote tne strike.pdf
 
7- 7- Caleulating Returns and Variability (LO1) Usine the followine re.pdf
7- 7- Caleulating Returns and Variability (LO1) Usine the followine re.pdf7- 7- Caleulating Returns and Variability (LO1) Usine the followine re.pdf
7- 7- Caleulating Returns and Variability (LO1) Usine the followine re.pdf
 
7- A perpetuity-immediate pays 1500 per year- Alice receives the first.pdf
7- A perpetuity-immediate pays 1500 per year- Alice receives the first.pdf7- A perpetuity-immediate pays 1500 per year- Alice receives the first.pdf
7- A perpetuity-immediate pays 1500 per year- Alice receives the first.pdf
 
7- A cohort study employs a- Subjects known at the start to have the d.pdf
7- A cohort study employs a- Subjects known at the start to have the d.pdf7- A cohort study employs a- Subjects known at the start to have the d.pdf
7- A cohort study employs a- Subjects known at the start to have the d.pdf
 
7- When I present the German Tank Problem- the most popular proposals.pdf
7- When I present the German Tank Problem- the most popular proposals.pdf7- When I present the German Tank Problem- the most popular proposals.pdf
7- When I present the German Tank Problem- the most popular proposals.pdf
 
7- (Microsoft Visual Basic) Display a triangle Hints- The following co.pdf
7- (Microsoft Visual Basic) Display a triangle Hints- The following co.pdf7- (Microsoft Visual Basic) Display a triangle Hints- The following co.pdf
7- (Microsoft Visual Basic) Display a triangle Hints- The following co.pdf
 
HELPPP Which of the following are differences in the recommendations.pdf
HELPPP   Which of the following are differences in the recommendations.pdfHELPPP   Which of the following are differences in the recommendations.pdf
HELPPP Which of the following are differences in the recommendations.pdf
 
Hemophilia is due to a recessive allele (h) linked to the X chromosome (1).pdf
Hemophilia is due to a recessive allele (h) linked to the X chromosome (1).pdfHemophilia is due to a recessive allele (h) linked to the X chromosome (1).pdf
Hemophilia is due to a recessive allele (h) linked to the X chromosome (1).pdf
 
Henry Ford- majority shareholder of the Ford Motor Company- announced.pdf
Henry Ford- majority shareholder of the Ford Motor Company- announced.pdfHenry Ford- majority shareholder of the Ford Motor Company- announced.pdf
Henry Ford- majority shareholder of the Ford Motor Company- announced.pdf
 
hen should a company use the fair value method to account for its equi.pdf
hen should a company use the fair value method to account for its equi.pdfhen should a company use the fair value method to account for its equi.pdf
hen should a company use the fair value method to account for its equi.pdf
 
HELPPPO A- B- What is the correct order of events that take plac.pdf
HELPPPO  A-    B-   What is the correct order of events that take plac.pdfHELPPPO  A-    B-   What is the correct order of events that take plac.pdf
HELPPPO A- B- What is the correct order of events that take plac.pdf
 
help please!thanks Ear Shape In pigs- erect ears are dominant (E) to d.pdf
help please!thanks Ear Shape In pigs- erect ears are dominant (E) to d.pdfhelp please!thanks Ear Shape In pigs- erect ears are dominant (E) to d.pdf
help please!thanks Ear Shape In pigs- erect ears are dominant (E) to d.pdf
 
HELP PLEASE A- B- What event is indicative of transcription init.pdf
HELP PLEASE  A-   B-    What event is indicative of transcription init.pdfHELP PLEASE  A-   B-    What event is indicative of transcription init.pdf
HELP PLEASE A- B- What event is indicative of transcription init.pdf
 
Help create the vcipher-h and vcipher-cc files for the vigenere cipher.pdf
Help create the vcipher-h and vcipher-cc files for the vigenere cipher.pdfHelp create the vcipher-h and vcipher-cc files for the vigenere cipher.pdf
Help create the vcipher-h and vcipher-cc files for the vigenere cipher.pdf
 
Help implement BST- The code must follow the instruction below as well.pdf
Help implement BST- The code must follow the instruction below as well.pdfHelp implement BST- The code must follow the instruction below as well.pdf
Help implement BST- The code must follow the instruction below as well.pdf
 
Help me create a use case diagram for this use case- Use case title-.pdf
Help me create a use case diagram for this use case-   Use case title-.pdfHelp me create a use case diagram for this use case-   Use case title-.pdf
Help me create a use case diagram for this use case- Use case title-.pdf
 

Recently uploaded

The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
DhatriParmar
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
gb193092
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
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
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
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
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
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)
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
goswamiyash170123
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
Mohammed Sikander
 
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
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 

Recently uploaded (20)

The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
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
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
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
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
 
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.
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 

Hello- we are learning generics in Java and looking at lists specifica.pdf

  • 1. Hello, we are learning generics in Java and looking at lists specifically. this is a method to add an item to a list. I don't understand how the statement in bold is working. Can anyone please break it down for me and explain how it works with the whole method? many thanks for considering my request. public void add(T a) { // if length of the list is equal to the size // resize the list, then add the element if (items.length == this.size) { this.resize(); } this.items[size] = a; this.size++; }