Explore topic-wise MCQs in Testing Subject.

This section includes 657 Mcqs, each offering curated multiple-choice questions to sharpen your Testing Subject knowledge and support exam preparation. Choose a topic below to get started.

1.

In PHP 5, how can you write a class so that some of its properties cannot be accessed from outside its methods?

A. By declaring the class as private
B. By declaring the property as private
C. It cannot be done
D. By writing a property overloading method
Answer» C. It cannot be done
2.

Which object-oriented pattern would you use to implement a class that must be instantiated only once for the entire lifespan of a script?

A. Model-view-controller
B. Abstract factory
C. Singleton
D. Proxy
Answer» D. Proxy
3.

What is the name of function used to convert an array into a string?

A. explode()
B. glue()
C. implode()
D. None of the above
Answer» D. None of the above
4.

How many type of Primitive Data Types exist in Java?

A. 5
B. 7
C. 8
D. 10
Answer» D. 10
5.

Which method of System class is used to copy array?

A. copyArray
B. arrayCopy
C. arraycopy
D. arrCopy
Answer» D. arrCopy
6.

Which keyword is used to inherit class?

A. inherit
B. extends
C. inheritance
D. extend
Answer» C. inheritance
7.

In how many ways is polymorphism achived in C++?

A. 2
B. 3
C. 1
D. 4
Answer» C. 1
8.

Data members is also called?

A. Attribute
B. Method
C. Class
D. Object
Answer» B. Method
9.

The parameter list in function overloading must differ by?

A. Number of functions
B. Function Size
C. Function Name
D. Number of argument
Answer» E.
10.

Which of the following data structure is linear type?

A. Strings
B. Queue
C. Lists
D. All of the above
Answer» E.
11.

What will be the output of the following C code? #include <stdio.h> void main() { register int x = 5; m(); printf("x is %d", x); } void m() { x++; }

A. 6
B. 5
C. Junk value
D. Compile time error
Answer» E.
12.

Which among the following is wrong for “register int a;”?

A. Compiler generally ignores the request
B. You cannot take the address of this variable
C. Access time to a is critical
D. None of the mentioned
Answer» E.
13.

Register storage class can be specified to global variables.

A. True
B. False
C. Depends on the compiler
D. Depends on the standard
Answer» C. Depends on the compiler
14.

What will be the output of the following C code? #include <stdio.h> int main() { register const int i = 10; i = 11; printf("%d\n", i); }

A. 10
B. Compile time error
C. Undefined behaviour
D. 11
Answer» C. Undefined behaviour
15.

What will be the output of the following C code? #include <stdio.h> int main() { register auto int i = 10; i = 11; printf("%d\n", i); }

A. 10
B. Compile time error
C. Undefined behaviour
D. 11
Answer» C. Undefined behaviour
16.

What will be the output of the following C code? #include <stdio.h> int main() { register static int i = 10; i = 11; printf("%d\n", i); }

A. 10
B. Compile time error
C. Undefined behaviour
D. 11
Answer» C. Undefined behaviour
17.

 register keyword mandates compiler to place it in machine register.

A. True
B. False
C. Depends on the standard
D. None of the mentioned
Answer» C. Depends on the standard
18.

What will be the output of the following C code? #include <stdio.h> int main() { register int i = 10; int *p = &i; *p = 11; printf("%d %d\n", i, *p); }

A. Depends on whether i is actually stored in machine register
B. 10 10
C. 11 11
D. Compile time error
Answer» E.
19.

int * ptr=(int *) realloc(NULL,100) is same as

A. int *ptr=(int *) malloc(20)
B. int *ptr=(int *) malloc(50)
C. int *ptr=(int *) calloc(25,4)
D. int *ptr=(int *) calloc(20,4)
Answer» D. int *ptr=(int *) calloc(20,4)
20.

output of following program #include<stdio.h> int f1( int ); void main() { int b=5; printf("%d,%d", f1(b),f1(b)); } int f1(int b) { static int n=5; n++; return n; }

A. 6,6
B. 6,7
C. 7,6
D. 5,6
Answer» D. 5,6
21.

The effectiveness of an algorithm is best stated in

A. Best-case Time
B. Average-case Time
C. Worst-Case running time
D. Industry-Standard Time
Answer» D. Industry-Standard Time
22.

Big O notation is defined for

A. Time and Space Complexity
B. Optimality
C. Searching
D. Sorting
Answer» B. Optimality
23.

Iterators are________________

A. Generalised pointers in STL
B. Container classes in STL
C. Algorithms in STL
D. Special Methods in STL
Answer» B. Container classes in STL
24.

What happens when the following piece of code in file1.c, is compiled and executed? namespace { Class Temp { public: int GetVal() { return 100; } }; } //end of namespace int main() { Temp oTempObj1; Cout< }

A. Compile Error
B. 100
C. Runtime Error
D. Compilation Error
Answer» C. Runtime Error
Previous Next