Explore topic-wise MCQs in CGI.

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

1.

In which circumstance it is not possible to assign default value to a parameter while declaring a function?

A. When the parameter is Boolean
B. When the function is being declared as a member of a class
C. When the parameter is being declared as passed by reference
D. When the function contains only one parameter
Answer» D. When the function contains only one parameter
2.

How does the identity operator === compare two values?

A. It converts both to a common compatible data type and then compares the values
B. It returns True only if they are both of the same type and value
C. It converts both values to strings and compares them
D. If the two values are strings, it performs a syntax comparison
Answer» C. It converts both values to strings and compares them
3.

PEAR stands for?

A. PHP Extension and Application Record
B. PHP Extended and Application Repository
C. PHP Extension and Application Repository
D. PHP Extension and Applicable Repository
Answer» D. PHP Extension and Applicable Repository
4.

PECL stands for?

A. PHP Extension Community Laboratory
B. PHP Extension Combined Library
C. PHP Export Community Library
D. PHP Extension Community Library
Answer» E.
5.

If cookie expiration time is not set explicitly, what happens to it?

A. It expires right away
B. It never expires
C. It is not set
D. It expires at the end of the users browser session
Answer» E.
6.

How are session variables accessed through?

A. $_GET
B. $_POST
C. $_REQUEST
D. None of the above
Answer» E.
7.

By default, PHP stores session data in ______________.

A. The filesystem
B. A database
C. Virtual memory
D. Shared memory
Answer» B. A database
8.

The ___________ function automatically transforms newline characters into HTML <br /> tags.

A. br2nl
B. nl2br
C. nlbr
D. None of the above
Answer» C. nlbr
9.

Address stored in the pointer variable is of type _________

A. Integer
B. Floating
C. Array
D. Character
Answer» B. Floating
10.

Which is not a valid keyword in java?

A. null
B. transient
C. synchronized
D. native
Answer» B. transient
11.

The Java programming language is a ________?

A. Machine Level Language
B. High Level Language
C. Assembly Level Language
D. None of the above
Answer» C. Assembly Level Language
12.

Which is not a valid comment style in Java

A. /* comment */
B. /* comment
C. /** comment */
D. // comment
Answer» C. /** comment */
13.

What is the correct signature of the main method?

A. public static void main(String[] args)
B. static public void main(String[] args)
C. public void main(String[] args)
D. A and B Both
Answer» E.
14.

A collection of methods with no implementation is called an ________.

A. Polymorphism
B. Inheritance
C. Interface
D. Data Binding
Answer» D. Data Binding
15.

How many type of Primitive Data Types exist in Java?

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

If you access an uninitialized local variable will result?

A. Syntax Error
B. Compile Time Error
C. Run Time Error
D. No Error
Answer» C. Run Time Error
17.

How integer literal can expressed binary data?

A. int binaryData = b11010;
B. int binaryData = bx11010;
C. int binaryData = 0b11010;
D. int binaryData = xb11010;
Answer» D. int binaryData = xb11010;
18.

Which is right way to declare Array?

A. int[] myArray;
B. int myArray[];
C. int []myArray;
D. A and B Both
Answer» E.
19.

Which is right way to creating an array of integer?

A. javaArray = new int[10];
B. javaArray new = myArray[10];
C. int[] javaArray = new int[10];
D. A and C Both
Answer» E.
20.

Which method of System class is used to copy array?

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

Which keyword is used to inherit class?

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

Overloaded methods are differentiated by

A. Number of arguments
B. Data type of arguments
C. Number and the Data type of the arguments
D. None of the above
Answer» D. None of the above
23.

Choose best option that describes Constructor.

A. Have no return type
B. Use name of the class and have no return type
C. Use name of the class
D. None of the above
Answer» C. Use name of the class
24.

To override a method in Java, we need to define a method in sub class with the

A. same name, same number of arguments having the same data types as a method in the super class
B. different name, same number of arguments having the same data type as a method in the super class
C. same name but different number of arguments as a method in the super class
D. same name, same number of arguments but different data types as a method in the super class
Answer» B. different name, same number of arguments having the same data type as a method in the super class
25.

Which of the following differentiates between overloaded functions and overridden functions?

A. Overloading is a dynamic or runtime binding and overridden is a static or compile time binding.
B. Overloading is a static or compile time binding and overriding is dynamic or runtime binding.
C. Redefining a function in a friend class is called overloading, while redefining a function in a derived class is called as overridden function.
D. Redefining a function in a derived class is called function overloading, while redefining a function in a friend class is called function overriding.
Answer» C. Redefining a function in a friend class is called overloading, while redefining a function in a derived class is called as overridden function.
26.

  Which method is called first by an applet program?

A. start( )
B. run( )
C. init( )
D. begin( )
Answer» D. begin( )
27.

Which of the following storage classes have global visibility in C?

A. Auto
B. Static
C. Extern
D. Register
Answer» D. Register
28.

  How many times is a do while loop guaranteed to loop?

A. 0
B. Variable
C. 1
D. Infinitely
Answer» D. Infinitely
29.

What is a step-by-step procedure used to solve a problem called?

A. algorithm
B. operating system
C. application program
D. all of these
Answer» B. operating system
30.

What is storage of 10 KB means in number of bytes ?

A. 1000
B. 10240
C. 1024
D. None of these
Answer» C. 1024
31.

What is a half byte known as ?

A. data
B. bit
C. bill
D. nibble
Answer» E.
32.

What is function of logic gate ?

A. It makes logic decisions
B. It works on binary algebra
C. It alternates between 0 and 1 values
D. None of these
Answer» B. It works on binary algebra
33.

What is a the output signal when the input to NOT gate is A=11100 ?

A. 00000
B. 00011
C. 11111
D. None of these
Answer» C. 11111