0
Alien head

programming languages Online Quiz - 84

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

Pass by reference and Pass by address are same in C++.

  1. True

  2. False


Correct Option: A

which of the below statemen(s)is(are) true for malloc() & new functions?

  1. malloc is used to allocate store for integer arrays only

  2. new is used to allocate store for objects only

  3. new is used to allocate any kind of memory

  4. malloc is used to allocate any kind of memory

  5. new initializes the store after allocation

  6. malloc intializes the store after allocation


Correct Option: C,D

What is singleton class?

  1. that can not be inherited

  2. that can be inherited only once

  3. that can have only one object

  4. there is no such class


Correct Option: C

int he below code, which declaration hold for copy constructor? class C{ int x; public: C(int t);//-----> (1) C(C t); //-----> (2) C(C& t); //-----> (3) C(C t, int k);// ------> (4) };

  1. (1)

  2. (2)

  3. (3)

  4. (4)


Correct Option: B,C

Which of the following statment(s) is(are) true for constructors & destructors

  1. constructors are executed only(once) when the first object is instantiated

  2. destructor is executed only at the end of main() execution

  3. constructors are executed on every object instantiation

  4. destructor is executed when all the objects of the class moves out of scope

  5. constructors can not take parameters


Correct Option: C

void func(){ double d; static int si; int i; }; where will be memory allocated for the variables?

  1. all(d,si,i) in stack

  2. d in stack;si in heap;i in stack

  3. d in stack;si in stack;i in heap

  4. d in heap;si in heap;i in stack


Correct Option: B

Which of the following statement(s) is(are) correct?

  1. constructors can be virtual

  2. destructors can be virtual

  3. constructors can be overloaded

  4. virtual functions are fast in execution


Correct Option: B,C

How is dynamic binding achieved in C++?

  1. Using virtual functions

  2. Using method overloading

  3. Using operator overloading

  4. Using both method & operator overloading


Correct Option: A

What is abstract class?

  1. A class which can not be inherited

  2. A class which can have only single object

  3. A class which can not have any objects

  4. A class which can not inherit other classes


Correct Option: C

Considereing int take 2 bytes of memory. What is size of memory allocated for ob in the below program.the size of memory allocated for object of class class my_class { int x; int y; public: void add(int k); void display(); }; my_class ob;

  1. 4 bytes

  2. 6 bytes

  3. 8 bytes

  4. 12 bytes


Correct Option: A

Which of the following is(are) true for Macro functions(#define fn()) & inline functions

  1. macro functions are expanded during compile. Inline functions are just usual functions calls

  2. macro functions are expanded during preprocessing and inline functions are expanded during compile

  3. macro functions are expanded during compile and inline functions are expanded during preprocessing

  4. No difference.Both are expanded at compile.


Correct Option: B

Which one is faster in java ? A. Math.max(a,b); B. (a>b)?a:b

  1. A

  2. B

  3. Both are Same

  4. None


Correct Option: B

what is the output? class A{ int i=1; void printit() { i=i++; system.out.println(i);} } class AS { public static void main(String s[]) { A a=new A(); a.printit(); } }

  1. 1

  2. 2

  3. Error

  4. None


Correct Option: A

Is following line throws Exception.If yes ,which type? justify it . float f = 100.00/0.0

  1. True

  2. False


Correct Option: B

What will be output from the following statements: System.out.println(1+2+”3”); System.out.println (“1”+2+3);

  1. 33,123

  2. 123,33

  3. 6,6

  4. Compilation Error


Correct Option: A

Is the following statement correct: char ch = 'd'; if(ch < 32.00){ }

  1. True

  2. False


Correct Option: A

Which is/are the method/s of an ADO.NET command object

  1. CreateObjRef

  2. BeginExecuteNonQuery

  3. Prepare

  4. All of the above


Correct Option: D

Which is not the an ADO.NET object

  1. SqlDataAdapter

  2. SqlConnection

  3. SqlDataReader

  4. SqlDataView


Correct Option: D

Method used in LINQ to SQL for database updation

  1. Commit();

  2. Update();

  3. SubmitChanges();

  4. CommitTransaction();


Correct Option: C

LINQ query to Select and return all the rows from Product table and display the product names.

  1. Dim query = From product In products.AsEnumerable() Select product

  2. Dim query as select product From product In products.AsEnumerable()

  3. Dim query = From p In products.AsEnumerable() Select p

  4. None of these


Correct Option: A
+ View questions