Android MCQ
Android MCQ
Which access modifier only lets the class it was declared in use the variable?
a. public
b. protected
c. default
d. private
Which of the following will cause the view to be as big as it needs to be to contain
its content?
a. match_parent
b. responsive_sizing
c. container
d. Wrap_content
Which attribute can you use to increase the "3d effect of a CardView?
a. cardElevation
b. You cannot make a CardView 3d
c. card3dHeight
d. cardCornerRadius
Which Intent method will let you send data from one activity to another?
a. putExtra
b. sendData
c. activityData
d. putData
What is a singleton?
a. A class with just one variable
b. A class with just one method
c. A class that can never be instantiated
d. A class where there can only be one instance
How would you set the value of the first item in an integer array?
a. intArray[0] = 100;
b. intArray[1] = 100;
c. intArray{0} = 100;
d. intArray{1} = 100;
How do you declare and initialize a new ArrayList containing Strings?
a. myList = new ArrayList.String();
b. String ArrayList[] myList;
c. ArrayList<String> myList = new ArrayList<String> ();
d. myList = new ArrayList[][]:
The RecyclerView class handles the data from an array directly to display it
a. True
b. False
What does the condition of a Java enhanced for loop look like?
a. foreach (int i in myArray)
b. for (int i = 0; 1 < myArray.length; it +)
c. for (int i : myArray)
d. enhancedfor (int i in myArray);
If we are writing code inside a "Fragment" class, how can we access a Context
object?
a. Use the 'this' operator
b. getContext()
c. getActivityContext()
d. All answers are correct