Explore topic-wise MCQs in Technical Programming.

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

1.

______ feature support reusability and extensibility of classes.

A. Overloading
B. Polymorphism
C. Inheritance
D. All options are wrong
Answer» D. All options are wrong
2.

Match the following Lists in FORTRAN:List-I List-II(a) RETURN(i) Physical end of program(b) STOP(ii) Temporarily halt the execution(c) PAUSE(iii) Value is received by the calling sub-program(d) END(iv) Terminates execution Correct code are:

A. a-ii, b-i, c-iii, d-iv
B. a-iv, b-ii, c-i, d-iii
C. a-i, b-iii, c-iv, d-ii
D. a-iii, b-iv, c-ii, d-i
Answer» E.
3.

Assertion (A): Encapsulation is implemented by a ‘class’ in C++.Reason (R): Private, public, and protected access specifiers are used.

A. Both (A) and (R) are true and (R) is the correct explanation of (A).
B. Both (A) and (R) are true, but (R) is not the correct explanation of (A).
C. (A) is true, but (R) is false.
D. (A) is false, but (R) is true.
Answer» B. Both (A) and (R) are true, but (R) is not the correct explanation of (A).
4.

In context C++, the process of individually copying each member of an object to the corresponding member of another object of the same class is known as __________ copying.

A. mutable
B. shallow
C. respective
D. default
Answer» C. respective
5.

In context of C++, which of the following is invalid statement?

A. Friend function of class is not considered a member function of the class.
B. Member function of a class can be defined outside the class.
C. Static data member of class can be accessed only by static member function of the class.
D. Static data member is initialized with a zero only.
Answer» D. Static data member is initialized with a zero only.
6.

______ variables are not reinitialized each time visual basic invokes a procedure and thus retains or preserves value even when a procedure ends

A. Static
B. Dynamic
C. Virtual
D. Private
Answer» B. Dynamic
7.

In which case it is mandatory to provide a destructor in a class?

A. Almost in every class
B. Class for which two or more than two objects will be created
C. Class for which copy constructor
D. Class whose objects will be created dynamically
Answer» E.
8.

Assertion (A): C++ is an object-oriented programming language.Reason (R): C++ supports class, inheritance, templates, and exception handling.

A. Both (A) and (R) are true and (R) is correct explanation of (A).
B. Both (A) and (R) are true, but (R) is not the correct explanation of (A).
C. (A) is true, but (R) is false.
D. (A) is false, but (R) is true.
Answer» B. Both (A) and (R) are true, but (R) is not the correct explanation of (A).
9.

_______ is used to combine data and its associated functions under a single unit.

A. Polymorphism
B. Inheritance
C. Association
D. Encapsulation
Answer» E.
10.

In context of C++, which of the following is not a type of ST container?

A. Derived
B. Associative
C. Active
D. Sequence
Answer» D. Sequence
11.

A function is called automatically each time an object is destroyed is a

A. Constructor
B. Destructor
C. Destroyer
D. Terminator
Answer» C. Destroyer
12.

_________ is used to declare and initialize an object from another object of same class in C++.

A. Copy constructor
B. Default constructor
C. Overloaded constructor
D. Non-parametrized constructor
Answer» B. Default constructor
13.

In C++, which of the following is not a valid access specifier?

A. private
B. public
C. protected
D. mutable
Answer» E.
14.

During exception handling, which of the following statements hold true?

A. Single try can have multiple associated catch with it
B. A Single Catch can have multiple try associated with it
C. Finally block execute only when the class is inherited
D. For a given exception, multiple catch can execute
Answer» B. A Single Catch can have multiple try associated with it
15.

A constructor with no argument is ______

A. Copy
B. All options are wrong
C. Parameterized
D. Default
Answer» E.
16.

A member function can always access the data in _______, (in C++).

A. the class of which it is member
B. the object of which it is a member
C. the public part of its class
D. the private part of its class
Answer» B. the object of which it is a member
17.

By default the members of a class are ______

A. Protected
B. Private
C. Public
D. All options are wrong
Answer» C. Public
18.

The string class deals with string of only character type.

A. True
B. False
Answer» B. False
19.

If two arguments are passed to the indexOf() function then ___________________

A. Second argument indicates the occurrence number of specified character from starting
B. Second argument indicates the occurrence number of specified character from end
C. Second argument indicates the index of the character in first argument
D. Second argument indicates the index of the character from the last of the string
Answer» B. Second argument indicates the occurrence number of specified character from end
20.

Function replace() accepts _____________ arguments.

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

String trim() function is used to _______________________

A. Remove all the white spaces from the string
B. Remove white space from start of string
C. Remove white space at end of string
D. Remove white space from both the ends of string
Answer» E.
22.

String class provides function toUpper() to _____________________

A. Convert first character to uppercase
B. Convert last character to uppercase
C. Convert the whole string characters to uppercase
D. Convert uppercase to lower and lower to uppercases
Answer» D. Convert uppercase to lower and lower to uppercases
23.

The compareTo() function is used to ________________

A. Compare strings value to string object
B. Compare string value to string value
C. Compare string object to another string object
D. Compare string object to another string value
Answer» D. Compare string object to another string value
24.

Function equals() is _______________ and equalIgnoreCase() is _________________

A. Case Insensitive, case insensitive
B. Case sensitive, Case insensitive
C. Case sensitive, case sensitive
D. Case insensitive, case sensitive
Answer» C. Case sensitive, case sensitive
25.

The function lastIndexOf() is used to ___________________

A. Get the index of last occurrence of specified character in argument
B. Get the index of first occurrence of specified character in argument
C. Get the index of last occurrence of first character in string
D. Get the index of last occurrence of last character of string
Answer» B. Get the index of first occurrence of specified character in argument
26.

String class have a concat() function that is used to _____________________

A. Replace old string by new string
B. Add two strings
C. Append one string at end of another string
D. Remove a string from end of one string
Answer» D. Remove a string from end of one string
27.

If two index are given as argument to substring function then ___________________

A. String of length equal to sum of two arguments is returned
B. String starting from first index and of length equal to send argument
C. String starting from first index and of length equal to sum of two arguments
D. String starting from first index and ending at second index position
Answer» E.
28.

If only one parameter is passed to substring function then __________________

A. It returns the character at the specified position
B. It returns the string of length 1 from the specified index
C. It returns the string from specified index till the end
D. It returns the string from starting of string till the specified index
Answer» D. It returns the string from starting of string till the specified index
29.

Which is the function to get the character present at a particular index in the string?

A. char charAt(index);
B. char charIn(StringName);
C. char charAt(StringName);
D. char charIn(index);
Answer» B. char charIn(StringName);
30.

What does function length do in String class?

A. Returns length of string including null character
B. Returns length of string excluding null character
C. Returns length of substring
D. Returns size of string in bytes
Answer» C. Returns length of substring
31.

How to declare an object of class String?

A. String object_Name = value;
B. String object_name = new;
C. String object_name= new value
D. String object_name= value new;
Answer» B. String object_name = new;
32.

Which is a true statement for object of String class?

A. Object are immutable
B. Object are mutable
C. Object are created only once
D. Object can’t be created
Answer» B. Object are mutable
33.

Which among the following is a serialization descriptor for any class?

A. StreamClass
B. ObjectStreamClass
C. ObjectStream
D. StreamObjectClass
Answer» C. ObjectStream
34.

RandomAccessFile can be used to _______________________

A. Read from a random access file
B. Write to a random access file
C. Read and write to a random access file
D. Restricts read and write to a random access file
Answer» D. Restricts read and write to a random access file
35.

StringReader handles _____________________

A. Any character stream
B. A character stream whose source is an array
C. A character stream whose source is character array
D. A character stream whose source is String only
Answer» E.
36.

Which class can handle IO class interrupt?

A. ExceptionIO
B. InteruptedIO
C. InteruptedIOException
D. IOInteruptException
Answer» D. IOInteruptException
37.

Reader class is _________________

A. Used to read from files
B. Abstract class to read character streams
C. Abstract class to input character streams
D. Used to take input from standard input stream
Answer» C. Abstract class to input character streams
38.

Which class among the following makes incorrect assumptions?

A. LineNumberInputStream
B. LineNumberReader
C. LineReader
D. LineBuffer
Answer» B. LineNumberReader
39.

What does FilePermission class do?

A. This class is used to give permission rights to a file
B. This class is used to restrict use of permissions
C. This class is used to represent device access permissions
D. This class is used to represent file access permissions
Answer» E.
40.

FileInputStream _________________________

A. Gets the input stream from any device file
B. Gets the input stream from any open socket
C. Gets the input stream from any cache
D. Gets the input stream from any open file only
Answer» E.
41.

What is a FileDescriptor?

A. A handle for machine specific structure of an open file
B. A handle for program specific structure of an open file
C. A handle for compiler specific structure of an open file
D. A handle for representing device files structure
Answer» B. A handle for program specific structure of an open file
42.

File class is ____________________________

A. An abstract of file representation only
B. An abstract of path names only
C. An abstract which can be used to represent path names or file
D. An abstract which can represent a file in any format
Answer» D. An abstract which can represent a file in any format
43.

Which among the following class contains the methods to access character based console device?

A. Console
B. File
C. Device
D. Pipe
Answer» B. File
44.

IO class provides input and output through ______________________

A. Data streams
B. Serialization
C. File system
D. Data streams, serialization and file system
Answer» E.
45.

What is the use of IO class?

A. To handle all the input operations
B. To handle all the output operations
C. To handle all the input and output operations
D. To handle all the input and output to the standard input
Answer» D. To handle all the input and output to the standard input
46.

Which package contains the utility classes?

A. java.lang
B. java.utility
C. java.util
D. java.io
Answer» D. java.io
47.

Which is not a System class variable?

A. err
B. out
C. in
D. put
Answer» E.
48.

What does load(String)::= function do, in System class?

A. Loads dynamic library for a path name
B. Loads all the dynamic libraries
C. Loads all the Number in string format
D. Loads the processor with calculations
Answer» B. Loads all the dynamic libraries
49.

Which class contain runFinalization() method?

A. Finalize
B. System
C. Final
D. SystemFinal
Answer» C. Final
50.

Which function should be used to exit from the program that is provided by System class?

A. exit(int);
B. gc();
C. terminate();
D. halt();
Answer» B. gc();