Mobile Application Development Which of the following is NOT true when overridin
ID: 3911438 • Letter: M
Question
Mobile Application Development
Which of the following is NOT true when overriding a method?
The subclass is given a method of the same signature as a superclass method.
The superclass method is hidden when called from the subclass.
The superclass method can no longer be used.
You can override any method of the superclass.
QUESTION 9
In the following onOptionsItemSelected() method, which id is most likely associated with accessing the application’s help page?
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.item1:
new();
return true;
case R.id.item2:
open();
return true;
case R.id.item3:
close();
return true;
case R.id.item4:
info();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
item1
item2
item4
none, it will be handled by the default case
QUESTION 10
Which line in the following code does NOT include an error?
0 public int foo() {
1 super.onDraw(canvas);
2 Paint dotPaint = new Paint();
3 dotPaint.setColor(Color.RED);
4 doble i = 1;
5 j = 2;
6 i = j * i;
7 j = Math.pow(i, j);
8 canvas.drawText(“i: “ + i + “|j: “ + j);
9 }
Line 4
Line 5
Line 7
Line 8
QUESTION 11
Match the terms to the corresponding definition below.
Visual components that the user sees when running an app
Components that wait for events outside the app to occur
Component that makes aspects of an app available to other apps
Activities with no user interface
Activity
Regular App
Broadcast Receiver
Broadcast Sender
Content Receiver
Content Provider
Services
Background Service
QUESTION 12
Which is the correct argument sent to the onCreateOptionsMenu method to provide your own menu behavior?
Activity act
Class clss
Menu menu
MenuItem item
QUESTION 13
Broadcast Receivers are terminated when the event they are waiting for occurs.
True
False
The subclass is given a method of the same signature as a superclass method.
The superclass method is hidden when called from the subclass.
The superclass method can no longer be used.
You can override any method of the superclass.
Explanation / Answer
8).You can override any method of the superclass.
It should not be overrided when declared as final, if decared the compiler shows a warning error.
9).Item 4
10).Line 7
because the data type spelling is wrong i.e double in line 4
11).Visual components that the user sees when running an app _ Activity
Components that wait for events outside the app to occur _ Background service
Component that makes aspects of an app available to other apps _ content provider
Activities with no user interface _ services
Content providers offers a method for sharing the data through other apps.
The services are employed in data processing and verify a fresh data.
12).Menu menu
13).True
Their role is to convey the alerts for user ,when a particular event arises