Quiz
cse quiz
Create a free account to finish this quiz
Save your progress and see your final score.
Already have an account? Sign in
Questions in this quiz (7)
1The keyword int is an example of:
- Aan operator
- Bhardware
- Ca variable
- Da type
- Enone of the above
2If you declare an array as char[] vals = {'a', 'b', 'c', 'd', 'e'}, then the array element vals[2] contains what value?
- A'a'
- B'b'
- C'c'
- D'd'
- E'e'
- FIt is impossible to tell
3The method declared with the header:
public static ArrayList<String> foo (ArrayList<Integer> x)
returns what?- AAn integer value
- BA String value
- CAn Integer arraylist
- DA String arraylist
- ENo value
- FCan't tell
4The category of methods whose purpose is to retrieve a values from an object:
- Amutator methods
- Baccessor methods
- Cstatic methods
- Dconstructor methods
- Eprivate methods
- Fnone of the above
5For the loop given below, what will the final value of I be when the loop is finished?
int i;
int[] arr = {3, 5, 3, 3, 1};
for (int j =1; j<arr.length; j++) {
i = arr[j-1] - arr[j];
}- A0
- B1
- C2
- D3
- E4
- F5
- GNone of the above
6Consider the header:
public static int bar (int j,ArrayList<String> arr).
Which of the following could be a correct method call?- Aint bar(j, arr)
- Bbar(int j, ArrayList<String> arr)
- Cint i = bar(j, arr)
- Dint bar(int j, ArrayList<String> arr)
- ENone are correct
7What value does the variable foo have at the end of this segment of code?
ArrayList<Integer> bar = new ArrayList<Integer>();
bar.add(1);
while (bar.size() < 6- A1
- B3
Information
- Description
- Quiz on cse quiz, created by Tyler Bond on 23/09/2015.
- Author
- Tyler Bond
- Language
- English
- Views
- 1
- Rating
- No ratings yet Rate this quiz