No handwrititng please and try to not be copied to avoid pligrisim. thank you Wr
ID: 3706983 • Letter: N
Question
No handwrititng please and try to not be copied to avoid pligrisim. thank youWrite the code needed to print all strings that start with the character 'A'. Write the code if: 1. The strings are stored in an array list; use any proper name for the array list and assume that it is already created and filled with the strings. 2. The strings are stored in an array; use any proper name for the array and assume that it is already created and filled with the strings. Note: for each part, write a for loop.
Explanation / Answer
Question1
Answer:
for(int i=0;i<list.size();i++) {
if(list.get(i).startsWith("A")) {
System.out.println(list.get(i));
}
}
Question1
Answer:
for(int i=0;i<list.length;i++) {
if(list[i].startsWith("A")) {
System.out.println(list[i]);
}
}