Q1/ Write the code needed to print all strings that start with the character 'A'. Write the code if:
- 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.
- 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, writing a for loop.
Q2/ Assume the following intValue class definition:
class intValue{
int x;
public void setX(int i){x=i;}
public int getX(){return x;}
}
Write the code needed to creating an array list of intValue elements, add 5 intValue objects to the array list, and set the value of x of each element to the index of the element. Also print the values of x of all elements on one line with no spaces. Note this means the output of this code is: 01234.