Computer Knowledge
Operating Systems
1,344 Questions
Test your computer knowledge with these questions on operating systems. The content covers various platforms including Unix, Linux, Windows, Android, and Macintosh. These questions are commonly asked in the computer knowledge sections of banking and government exams.
Unix emulatorsLinux distributionsAndroid software stackMacintosh operating systemsWindows OS versionsSymbian OS history
Operating Systems Questions
-
getSharedPreferences()
-
getPreferences()
-
Both (1) and (2)
-
None of these
B
Correct answer
Explanation
The getPreferences() method (called without a name parameter) creates a single preferences file specific to that activity. In contrast, getSharedPreferences() requires a name parameter and can be shared across different activities or components.
-
shared preferences
-
internal storage
-
external storage
-
Both (1) and (2)
D
Correct answer
Explanation
SharedPreferences and internal storage are private to each application and reside in the app's sandbox, so they require no special permissions. External storage does require permissions (though the exact permissions have changed across Android versions - WRITE_EXTERNAL_STORAGE, READ_EXTERNAL_STORAGE, or scoped storage in newer APIs).
-
is same for all devices
-
may vary for different devices
-
is Mnt/sdcard
-
None of these
B
Correct answer
Explanation
The external storage directory path varies across devices - different manufacturers use different mount points (e.g., /mnt/sdcard, /sdcard, /storage/emulated/0). Developers should never hardcode paths and should always use the Environment.getExternalStorageDirectory() API or the Storage Access Framework for compatibility.
-
Object
-
Class
-
Android
-
Root
-
None of these
A
Correct answer
Explanation
Object is the base class for all the classes in JAVA. There is no change in it when it comes to Android application.
-
onStartCommand()
-
onBind()
-
onUnbind()
-
onIntent()
-
onDestroy()
D
Correct answer
Explanation
Object is the base class for all the classes in JAVA. There is no change in it when it comes to Android application. Context is the base class for activity class in an android application.
-
getContentResolver().delete(myRowUri, null);
-
getContentResolver().delete(myRowUri);
-
getContentResolver().delete(myRowUri, null, null);
-
getContentResolver().delete(MyProvider.CONTENT_URI, where, null);
-
Both (3) and (4)
E
Correct answer
Explanation
This is the correct option.
-
Intent intent = new Intent(MyActivity.this, MyOtherActivity); startActivity(intent);
-
Intent intent = new Intent(MyActivity.this, MyOtherActivity.class); startActivity(intent);
-
Intent intent = new Intent(MyActivity.class, MyOtherActivity.class); startActivity(intent);
-
Intent intent = new Intent(this, MyOtherActivity.this); startActivity(intent);
-
Intent intent = new Intent(MyOtherActivity.class); startActivity(intent);
B
Correct answer
Explanation
After calling startActivity, the new activity, i.e. MyOtherActivity will be created and will move to the top of the activity stack.
-
Activities
-
Services
-
Broadcast receivers
-
None of these
-
Create()
-
onCreate()
-
Start()
-
onStart()
-
onCreate()
-
onStart()
-
onResume()
-
onInterrupt()
Match the callback methods in an activity class with their description.
|
|
| (a) onCreate() |
1. It is called when the first activity is created. |
| (b) onStart() |
2. It is called when activity restarts after stopping it. |
| (c) onResume() |
3. It is called before the activity is destroyed by the system. |
| (d) onPause() |
4. It is called when the activity is no longer visible. |
| (e) onStop() |
5. It is called when the activity becomes visible to the user. |
| (f) onDestroy() |
6. It is called when the user starts interacting with the application. |
| (g) onRestart() |
7. When It is called, the paused activity does not receive any further user input and cannot execute any code. |
-
a – 1; b – 5; c – 6; d – 7; e – 4; f – 3; g – 2
-
a – 2; b – 5; c – 6; d – 7; e – 4; f – 3; g – 1
-
a – 2; b – 4; c – 6; d – 7; e – 5; f – 3; g – 1
-
None of these
-
Only A
-
Only B
-
Both A and B
-
Neither A nor B
B
Correct answer
Explanation
The getCount() returns the total number of fragments in the pages and the getItem() returns the fragment at the specified position.This method will be called as the user scrolls through the pages.
-
doInBackground()
-
doInFront()
-
onPreExecute()
-
onPostExecute()
B
Correct answer
Explanation
Following are the methods provided by AsyncTask:
doInBackground(), onPreExecute(),onPostExecute(), onProgressUpdate(), isCancelled(). There is no method called doInFront() provided by AsyncTask.
-
onDestroy
-
onPause
-
onRewind
-
onResume