3i Infotech Placement: Sample Questions 333 - 335 of 1245
Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.
Question 333
Explanation
- Note the following parts of the page table entry, which includes physical address of the page and protection bits.
- Page address
- Age
- Copy on write
- Modify
- Reference
- Valid
- A modified bit is set if the page has been altered since it was last loaded into main memory- an unset bit means page does not have be written to the disk when swapped out.
- Other control bits represent protection and permission at the page level.
- A read-only/read-write bit.
- Kernel page or user page.
Question 334
Explanation
- Swing components are derived from abstract javax. swing. Jcomponet class.
- Which has following hierarchy:
java. lang. Object
java. awt. component
java. awt. container
javax. swing. jcomponent
It replaces selection of AWT GUI components.
Question 335
Describe in Detail Essay▾
Describe the storage allocation and scope of global, extern, static, local and register variables?
EditExplanation
- Storage allocation concerns with the memory that is, where the storage space is allocated for variables and functions.
- Scope of a variable is implicitly determined by its storage allocation.
- Storage allocation is specified by the keywords auto, extern, static and register.
- ‘auto’ variables
- Store in the memory storage.
- Majority of the variables in a program.
- Their scope might be local or global.
- ‘extern’ variables
- Global variables and can be declared in another source file which could be external
- They are obviously allocated on the heap accessible across function calls etc.
- ‘register’ variables
- Allocated in the CPU registers.
- Storage and accessibility is faster than other variables as they are stored in CPU itself.
- Use for variables with repeated usage or critical access time.
- ‘static’ variables
- Survive lifetime of the program and unlike global variables provide limited scope.
- These variables are automatically initialized to zero and could be specified as ‘auto’ and ‘extern’ variables.
- The values are retained, even though they are declared in local scope, between the repeated function calls to the same function.