SlideShare a Scribd company logo
What is the output of running class GenericMethodDemo of the following code?
public class GenericMethodDemo {
public static void main(String[] args ) {
Integer[] integers = {1, 2, 3, 4, 5};
String[] strings = {"London", "Paris", "Dhaka",
"Austin", "Sydney"};
GenericMethodDemo.print(integers);
GenericMethodDemo.print(strings);
}
public static void print(E[] list) {
for (int i = 0; i < list.length; i++){
System.out.print(list[i] + " ");
}
System.out.println();
}
}
What is the output of running class GenericMethodDemo of the following code?
public class GenericMethodDemo {
public static void main(String[] args ) {
Integer[] integers = {1, 2, 3, 4, 5};
String[] strings = {"London", "Paris", "Dhaka",
"Austin", "Sydney"};
GenericMethodDemo.print(integers);
GenericMethodDemo.print(strings);
}
public static void print(E[] list) {
for (int i = 0; i < list.length; i++){
System.out.print(list[i] + " ");
}
System.out.println();
}
}
Solution
output 1 :
London
Paris
Dhaka
Austin
Sydney
The above is the output of hte above program

More Related Content

PDF
In 1998, Congress passed legislation concerning shifting the burden .pdf
PDF
If A denotes some event, what does A denote If P(A)equals=0.997, wh.pdf
PDF
How do neutrophils find and get to an infectionSolutionNeutro.pdf
PDF
How many times will the following code print Welcome to Java in.pdf
PDF
From your own words not copy past from internet please Talked about.pdf
PDF
Forms an important part of the subunits of the ribosome. The _ are sp.pdf
PDF
During DNA replication, a series of steps are required to ensure tha.pdf
PDF
Disease X occurs when someone has the xx genotype. However, only 20 .pdf
In 1998, Congress passed legislation concerning shifting the burden .pdf
If A denotes some event, what does A denote If P(A)equals=0.997, wh.pdf
How do neutrophils find and get to an infectionSolutionNeutro.pdf
How many times will the following code print Welcome to Java in.pdf
From your own words not copy past from internet please Talked about.pdf
Forms an important part of the subunits of the ribosome. The _ are sp.pdf
During DNA replication, a series of steps are required to ensure tha.pdf
Disease X occurs when someone has the xx genotype. However, only 20 .pdf

More from bhim1213 (20)

PDF
Darwins Theory had five main tenets (or components), what are they.pdf
PDF
Define toxic shock syndrome (TSS) impetigo MRSASolutionAnswer.pdf
PDF
A system was set up in parallel with two components, A and B. The pr.pdf
PDF
All content is made permanent for future use. All content will be lo.pdf
PDF
a. A waitress is serving 5 people at a table. She has the 5 dishes t.pdf
PDF
Biochemistry homework Focus concept ripening fruit and the activity.pdf
PDF
A process that has its representative PCB in a device queue is in th.pdf
PDF
Which of the following statements is (are) trueI Cash flow is a.pdf
PDF
What is the relationship of the epithelium of the epidermis to the co.pdf
PDF
What is a linked listWhat is a linked lists general syntaxCan .pdf
PDF
What do you think are the roles of professional societies in contemp.pdf
PDF
What is the compensation depth for phytoplankton How does it differ .pdf
PDF
what are structured data types give an exampleSolutionDefini.pdf
PDF
VoIP uses which of the following because network congestion can be s.pdf
PDF
Week #9 Nervous System IIIThe sequence of information flow in re.pdf
PDF
Under what assumptions would Multiple Regtression be usedSoluti.pdf
PDF
Trying to figure out this sequencing quesiton. Please explain how yo.pdf
PDF
To create a node for a binary search tree (BTNode, ) and to create a .pdf
PDF
The Morse code (see Table 6.10 in book) is a common code that is use.pdf
PDF
The Jannuschs operated Festival Foods, a business that served conces.pdf
Darwins Theory had five main tenets (or components), what are they.pdf
Define toxic shock syndrome (TSS) impetigo MRSASolutionAnswer.pdf
A system was set up in parallel with two components, A and B. The pr.pdf
All content is made permanent for future use. All content will be lo.pdf
a. A waitress is serving 5 people at a table. She has the 5 dishes t.pdf
Biochemistry homework Focus concept ripening fruit and the activity.pdf
A process that has its representative PCB in a device queue is in th.pdf
Which of the following statements is (are) trueI Cash flow is a.pdf
What is the relationship of the epithelium of the epidermis to the co.pdf
What is a linked listWhat is a linked lists general syntaxCan .pdf
What do you think are the roles of professional societies in contemp.pdf
What is the compensation depth for phytoplankton How does it differ .pdf
what are structured data types give an exampleSolutionDefini.pdf
VoIP uses which of the following because network congestion can be s.pdf
Week #9 Nervous System IIIThe sequence of information flow in re.pdf
Under what assumptions would Multiple Regtression be usedSoluti.pdf
Trying to figure out this sequencing quesiton. Please explain how yo.pdf
To create a node for a binary search tree (BTNode, ) and to create a .pdf
The Morse code (see Table 6.10 in book) is a common code that is use.pdf
The Jannuschs operated Festival Foods, a business that served conces.pdf

Recently uploaded (20)

PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
RMMM.pdf make it easy to upload and study
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
Lesson notes of climatology university.
PPTX
GDM (1) (1).pptx small presentation for students
PPTX
master seminar digital applications in india
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
Classroom Observation Tools for Teachers
PDF
A systematic review of self-coping strategies used by university students to ...
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Complications of Minimal Access Surgery at WLH
PPTX
Institutional Correction lecture only . . .
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
RMMM.pdf make it easy to upload and study
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Microbial disease of the cardiovascular and lymphatic systems
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Lesson notes of climatology university.
GDM (1) (1).pptx small presentation for students
master seminar digital applications in india
STATICS OF THE RIGID BODIES Hibbelers.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Microbial diseases, their pathogenesis and prophylaxis
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Classroom Observation Tools for Teachers
A systematic review of self-coping strategies used by university students to ...
O5-L3 Freight Transport Ops (International) V1.pdf
Complications of Minimal Access Surgery at WLH
Institutional Correction lecture only . . .
Chapter 2 Heredity, Prenatal Development, and Birth.pdf

What is the output of running class GenericMethodDemo of the followi.pdf

  • 1. What is the output of running class GenericMethodDemo of the following code? public class GenericMethodDemo { public static void main(String[] args ) { Integer[] integers = {1, 2, 3, 4, 5}; String[] strings = {"London", "Paris", "Dhaka", "Austin", "Sydney"}; GenericMethodDemo.print(integers); GenericMethodDemo.print(strings); } public static void print(E[] list) { for (int i = 0; i < list.length; i++){ System.out.print(list[i] + " "); } System.out.println(); } } What is the output of running class GenericMethodDemo of the following code? public class GenericMethodDemo { public static void main(String[] args ) { Integer[] integers = {1, 2, 3, 4, 5}; String[] strings = {"London", "Paris", "Dhaka", "Austin", "Sydney"}; GenericMethodDemo.print(integers); GenericMethodDemo.print(strings); } public static void print(E[] list) { for (int i = 0; i < list.length; i++){ System.out.print(list[i] + " "); } System.out.println(); }
  • 2. } Solution output 1 : London Paris Dhaka Austin Sydney The above is the output of hte above program