0

programming languages Online Quiz - 344

Description: programming languages Online Quiz - 344
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0

1.Set s = new TreeSet(); 2.s.add("JAVA"); 3.s.add(new Integer(5)); Line 3 will give ClassCast Exception because Two different types of object are getting added.

  1. True

  2. False


Correct Option: A

In which event are the controls fully loaded?

  1. Page load

  2. Page_Init

  3. Control events

  4. Page- prerender


Correct Option: A

AI Explanation

To answer this question, you need to understand the page lifecycle in ASP.NET.

The page lifecycle in ASP.NET consists of several events that occur during the processing of a web page. These events include Page_Init, Control events, Page_Load, and Page_PreRender.

Option A) Page load - This option is correct. The Page_Load event occurs after the Page_Init event and is responsible for loading and initializing the controls on the page. This event is triggered when the page is fully loaded.

Option B) Page_Init - This option is incorrect. The Page_Init event occurs early in the page lifecycle and is used for initializing the page and its controls. At this point, the controls may not be fully loaded.

Option C) Control events - This option is incorrect. Control events occur after the Page_Init event and before the Page_Load event. These events are specific to individual controls on the page and are not related to the loading of all controls.

Option D) Page_PreRender - This option is incorrect. The Page_PreRender event occurs after the Page_Load event and is used for finalizing the page before it is rendered to the user. At this point, the controls have already been loaded.

The correct answer is option A) Page load. This option is correct because the Page_Load event is where the controls on the page are fully loaded and initialized.

What is event bubbling?

  1. Parent control send events to child

  2. child control send events to parent

  3. only in child control

  4. only in Parent control


Correct Option: B
  1. 'ViewStateMac' property to false

  2. 'EnableViewStateMac' property to false

  3. 'EnableViewStateMac' property to True

  4. 'ViewStateMac' property to true


Correct Option: C

Where is View State information stored?

  1. In session

  2. In HTML Hidden Fields.

  3. In application session

  4. All the above


Correct Option: B
  1. execute ASP.NET application level events and setting application-level variables

  2. setting application-level variables.

  3. execute ASP.NET application level events.

  4. All the above


Correct Option: A

How do we assign page specific attributes?

  1. @Register directive.

  2. @Page directive.

  3. @control directive.

  4. All the above


Correct Option: B

What is the value of variable z when the following program segment ends? int z; for(z=0; z<50; z++) {}

  1. 51

  2. 49

  3. 0

  4. 50


Correct Option: D

Which of the following operators cannot be overloaded?

  1. sizeof

  2. ::

  3. :?

  4. All the Above


Correct Option: D

The vtable entry for a pure virtual function in C++ is

  1. zero

  2. NULL

  3. one

  4. No Entry in vtable


Correct Option: B

For the class exforsys defined as below: class exforsys() { }; int main() { exforsys a; } Which of the following is TRUE?

  1. No default constructor is provided by the compiler

  2. The compiler provides the default constructor

  3. The compiler generates error

  4. None of the Above


Correct Option: B
Explanation:

In the given code, a class named "exforsys" is defined. It does not have any member variables or functions.

Now, let's go through each option and determine which one is true:

A. No default constructor is provided by the compiler: This option is incorrect. By default, if no constructor is defined in a class, the compiler provides a default constructor. So, this option is false.

B. The compiler provides the default constructor: This option is correct. When no constructor is defined in a class, the compiler automatically generates a default constructor. So, this option is true.

C. The compiler generates an error: This option is incorrect. Since the class does not have any member variables or functions, there is no reason for the compiler to generate an error. So, this option is false.

D. None of the above: This option is incorrect. As explained earlier, the correct answer is option B. So, this option is false.

Therefore, the correct answer is:

B. The compiler provides the default constructor.

The friend function of a class in C++ can access

  1. Private members of the class

  2. protected members of the class

  3. Both A and B

  4. None of the Above


Correct Option: C

Which programming language was invented by Dennis Ritchie in 1972?

  1. C++

  2. C

  3. JAVA

  4. COBOL


Correct Option: A

Which programming language resembles its name to coffee?

  1. JAVA

  2. SIMULA

  3. C++

  4. B


Correct Option: A

JAVA promised which one of these?

  1. Write Once, Run Anywhere

  2. Read Once, Write Anywhere

  3. Read Once, Run Anywhere

  4. Write Twice, Run Once


Correct Option: A

Which programming language was invented by Dennis Ritchie in 1972?

  1. C++

  2. C

  3. JAVA

  4. COBOL


Correct Option: B

C++ programming language was invented by _______.

  1. Dennis Ritchie

  2. James Gosling

  3. Bjarne Stroustrup

  4. Ken Thompson


Correct Option: C

int ThatsMyFunction() { return 5; } void main() { printf("%u",ThatsMyFunction); }

  1. Compilation Error

  2. Some Unknown Random Number

  3. 5

  4. I Dont Know


Correct Option: B

void main() { int i; char *item; for(i=0;i<512;i++,item++) printf("%c",item); }

  1. ASCII Table - twice

  2. Segmentation fault

  3. I hate this Quiz and I dont know it

  4. Compilation Error


Correct Option: A
- Hide questions