Android Programming (2180715) MCQs

MCQs of Background Tasks

Showing 21 to 30 out of 32 Questions
21.
By using AsyncTask, do we need to add any custom handler to publish the result to UI thread?
(a) Yes
(b) No
Answer:

Option (b)

22.
Can we create an instance of the AsyncTask class directly?
(a) Yes
(b) No
Answer:

Option (a)

23.
What method must be overridden for using AsyncTask?
(a) doInBackground
(b) onProgressUpdate
(c) onPostExecute
(d) All of the above
Answer:

Option (a)

24.
Can we create an instance of AsyncTask from a service's process?
(a) Yes
(b) No
Answer:

Option (a)

25.
How many time can a task run?
(a) Just one
(b) Multiple times
(c) Infinite
(d) Zero times
Answer:

Option (a)

26.
What will happen if a task is executed the second time?
(a) An exception will be thrown
(b) The task will be run as normal from the beginning
(c) The execution will be ignored
Answer:

Option (a)

27.
In order to access member fields in doInbackground method where should we set them?
(a) In constructor
(b) In onPreExecute
(c) On onProgressUpdate
(d) A&B
Answer:

Option (d)

28.
In a JSON file, a _____ bracket represents a JSON array.
(a) [
(b) {
(c) (
(d) <
Answer:

Option (a)

29.
In a JSON file, _____ bracket represents a JSON object.
(a) [
(b) {
(c) (
(d) <
Answer:

Option (b)

30.
Classes to manipulate JSON data are
(a) JSONArray
(b) JSONObject
(c) JSONStringer
(d) All of the above
Answer:

Option (d)

Showing 21 to 30 out of 32 Questions