Sail E0 Webinar

MCQs

Total Questions : 38 | Page 4 of 4 pages
Question 31. What is a closure?
  1.    Function objects
  2.    Scope where function’s variables are resolved
  3.    Both Function objects and Scope where function’s variables are resolved
  4.    None of the mentioned
 Discuss Question
Answer: Option C. -> Both Function objects and Scope where function’s variables are resolved
Question 32. Which of the following are examples of closures?
  1.    Objects
  2.    Variables
  3.    Functions
  4.    All of the mentioned
 Discuss Question
Answer: Option D. -> All of the mentioned
Question 33. Which of the following uses a lot of CPU cycles?
  1.    GUI
  2.    Statically generated graphics
  3.    Dynamically generated graphics
  4.    All of the mentioned
 Discuss Question
Answer: Option C. -> Dynamically generated graphics
Question 34. Consider the following code snippet :
var scope = "global scope";
function checkscope() {
var scope = "local scope";
function f()
{
return scope;
}
return f;
What is the function of the above code snippet?
  1.    Returns value null
  2.    Returns exception
  3.    Returns the value in scope
  4.    None of the mentioned
 Discuss Question
Answer: Option C. -> Returns the value in scope
Question 35. What is the fundamental rule of lexical scoping?
  1.    Functions are declared in the scope
  2.    Functions are executed using scope chain
  3.    All of the mentioned
  4.    None of the mentioned
 Discuss Question
Answer: Option B. -> Functions are executed using scope chain
Question 36. What is the opposite approach to the lexical scoping?
  1.    Literal scoping
  2.    Static scoping
  3.    Dynamic scoping
  4.    Generic scoping
 Discuss Question
Answer: Option C. -> Dynamic scoping
Question 37. What is the purpose of the dynamic scoping?
  1.    Variables can be declared outside the scope
  2.    Variables must be declared outside the scope
  3.    Variables cannot be declared outside the scope
  4.    None of the mentioned
 Discuss Question
Answer: Option A. -> Variables can be declared outside the scope
Question 38. Which of the algorithmic languages is lexical scoping standardized in?
  1.    Ada
  2.    Pascal
  3.    Modula2
  4.    All of the mentioned
 Discuss Question
Answer: Option D. -> All of the mentioned

Latest Videos

Latest Test Papers