Q1/ What are the problems in the following design of class A:
class A{
int x;
public void setX(int d){x=d+5; d++;}
public int getX(){return x;}
public void printX(){System.out.println("x = "+x);}
}
Q2/ Write statements needed to do the following in order; one statement is needed for each point:
- Creating an array of 5 integers that are all initialized to 1's
- Modify the second element of your array (the array you created in part 1) to 8
- Print the last element of your array (the array you created in part 1)
- Creating an array list of boolean values