Вы находитесь на странице: 1из 14

If your object must inherit behavior from a number of sources you must use a/an

a) Interface
b) Object
c) Abstract class
d) Static class

Which method is used to tweak an object’s cloning behavior?


a) clone()
b) __clone()
c) _clone
d) object_clone()

Destructor has the same name as the constructor and it is preceded by ______ .
!
?
~
$

Which of the following advanced OOP features is/are not supported by PHP?
i) Method overloading
ii) Multiple Inheritance
iii) Namespaces
Object Cloning

What happens when we try to compile the class definition in following code snippet?
class Birds {};
class Peacock : protected Birds {};

It will not compile because class body of Birds is not defined.


It will not compile because class body of Peacock is not defined.
It will not compile because a class cannot be protectedly inherited from other class.
It will compile succesfully.

The uses ofstrcmp( )function in PHP?


A. It compare strings including case
B. It compare strings excluding case
C. It compare strings only Uppercase
D. It compare strings only lowercase

What will be the result of combining a string with another data type in PHP?
A. int
B. float
C. string
D. double

How many instances of an abstract class can be created?

1
5
13
0

Which of the following is used to add comments in PHP?


//
/* ... * /
& ... &
Only A & B

In how many ways we can retrieve the data in the result set of MySQL using PHP?
mysql_fetch_row.
mysql_fetch_array
mysql_fetch_object
mysql_fetch_assoc

Which of the following statements about virtual base classes is correct?


It is used to provide multiple inheritance.
It is used to avoid multiple copies of base class in derived class.
It is used to allow multiple copies of base class in a derived class.
It allows private members of the base class to be inherited in the derived class.

When function have same prototype in base class as well as in derived class function is called
Overloading function
Overriding function
Chained function
All of them

What does the class definitions in following code represent?


class Bike
{
Engine objEng;
};
class Engine
{
float CC;
};
kind of relationship
has a relationship
Inheritance
Both A and B

Serialize ( ) function takes a value of any type and then


Decodes the value in integer form
Encodes a value into strings
Changes the value into characters
None of them

A process that converts a string of bytes in such a way that you can produce original data again, is known as
Synchronization
Specialization
Serialization
Parallelization

Which of the following statements is correct about the program given below?
class Bix
{
public:
static void MyFunction();
};
int main()
{
void(*ptr)() = &Bix::MyFunction;
return 0;
The program reports an error as pointer to member function cannot be defined outside the definition of class.
The program reports an error as pointer to static member function cannot be defined.
The program reports an error as pointer to member function cannot be defined without object.
The program reports linker error.

Which of the following statement is correct?


C++ enables to define functions that take constants as an argument.
We cannot change the argument of the function that that are declared as constant.
Both A and B.
We cannot use the constant while defining the function.

What is storage class for variable A in below code?


void main()
{ int A;
A = 10;
printf("%d", A); }
(A) extern
) auto
register
static

Find Output
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
char temp[20];
gcvt(23.45,2, temp);
printf("%s", temp);
return 0;}
(A) .4
(B) 23
(C) 23.45
(D) 23.

What is output of below code?


void main()
{ char name[]="CPPPPC";
int len;
int size;
len = strlen(name);
size = size_of(name);
printf("%d,%d",len,size); }
(A) 6,6
(B) 6,7
(C) 7,7
(D) 0,0

Which of the following function declaration is/are incorrect?


int Sum(int a, int b = 2, int c = 3);
int Sum(int a = 5, int b);
int Sum(int a = 0, int b, int c = 3);
Both B and C are incorrect.
All are correct.

Find Output
int main()
{ int _ = 10;
int __ = 20;
int ___ = _ + __;
printf("__%d",___);
return 0; }
(A) Compilation Error
(B) Runtime Error
(C) __0
(D) __30

Find Output
//This question is compiled on 32 bit DEV-C++
int main()
{ char *ptr1, *ptr2;
printf("%d %d", sizeof(ptr1), sizeof(ptr2));
return 0; }
(A) 1 1
(B) 2 2
(C) 4 4
(D) Undefined

class A : public X, public Y


{}
Multilevel inheritance
Multiple inheritance
Hybrid inheritance
Hierarchical Inheritance

Which of the following function prototype is perfectly acceptable?


int Function(int Tmp = Show());
float Function(int Tmp = Show(int, float));
Both A and B.
float = Show(int, float) Function(Tmp);
Find Output
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
int a = atoi("100");
printf("%d",a);
return 0; }
(A) 0
(B) 1
(C) 100
(D) 3

Find Output
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
char buffer[4];
itoa(123, buffer, 10);
printf("%s", buffer);
return 0;}
(A) 1234
(B) 12340
(C) 123
(D) 0

What is the extension of output file produced by Preprocessor?


(A) .h
(B) .exe
(C) .i
(D) .asm

Find Output
void main()
{ printf(“\nab”);
printf(“\bsi”);
printf(“\rha”);
}
(A). absiha
(B). asiha
(C). haasi
(D). hai

Which gcc flag is used to generate maximum debug information?


(A) gcc -g0
(B) gcc -g1
(C) gcc -g
(D) gcc -g3
a

c
d

a
b All right
c
d

a
b

d
c

b
d

a
c

d
d

Вам также может понравиться