Programming Languages NTA UGC NET Question Analysis

Programming Languages NTA UGC NET Question Analysis


Q1➡ |
A member function can always access the data in ……………. ,(in C++).
i ➥ the class of which it is member
ii ➥ the object of which it is a member
iii ➥ the public part of its class
iv ➥ the private part of its class

Show Answer With Best Explanation

Answer: I
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q2➡ |
‘*ptrdata’ is a pointer to a data type. The expression *ptrdata++ is evaluated as (in C++):
i ➥ *(ptrdata++)
ii ➥ (*ptrdata++)
iii ➥ (*ptrdata++)
iv ➥ *(ptrdata)++

Show Answer With Best Explanation

Answer: I
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q3➡ |
The associativity of which of the following operators is Left to Right, in C++?
i ➥ Unary Operator
ii ➥ Logical not
iii ➥ Array element access
iv ➥ addressof

Show Answer With Best Explanation

Answer: III
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q4➡ |
If a function is friend of a class, which one of the following is wrong?
i ➥ A function can only be declared a friend by a class itself.
ii ➥ Friend functions are not members of a class, they are associated with it.
iii ➥ Friend functions are members of a class.
iv ➥ It can have access to all members of the class, even private ones.

Show Answer With Best Explanation

Answer: III
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q5➡ |
Which of the following is not a member of class ?
i ➥ Static function
ii ➥ Friend function
iii ➥ Const function
iv ➥ Virtual function

Show Answer With Best Explanation

Answer: II
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q6➡ |
……………… allows to create classes which are derived from other classes, so that they automatically include some of its “parent’s” members, plus its own members.
i ➥ Overloading
ii ➥ Inheritance
iii ➥ Polymorphism
iv ➥ Encapsulation

Show Answer With Best Explanation

Answer: II
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q7➡ |
Member of a class specified as …………… are accessible only to method of the class.
i ➥ private
ii ➥ public
iii ➥ protected
iv ➥ derive

Show Answer With Best Explanation

Answer: I
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q8➡ |
Match the following:
Set-I
(a) Garbage collection in
(b) Nameless object
(c) Template support
(d) A forward reference
(e) Derived class inherits from base class
Set-II
1- Java
2- generic programming
3- defines a class
4- member function
5- within a statement
Codes :
(a) (b) (c) (d) (e)
i ➥ 1 5 4 2 3
ii ➥ 1 5 2 3 4
iii ➥ 5 1 2 3 4
iv ➥ 5 4 3 1 2

Show Answer With Best Explanation

Answer: I (Marks to all )
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q9➡ |
The data type created by the data abstraction process is called.
i ➥ class
ii ➥ structure
iii ➥ abstract data type
iv ➥ user defined data type

Show Answer With Best Explanation

Answer: III
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q10➡ |
Which of the statements are true?
I. Function overloading is done at compile time.
II. Protected members are accessible to the member of derived class.
III. A derived class inherits constructors and destructors.
IV. A friend function can be called like a normal function. V. Nested class is a derived class.
i ➥ I, II, III
ii ➥ II, III, V
iii ➥ III, IV, V
iv ➥ I, II, IV

Show Answer With Best Explanation

Answer: IV
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q11➡ |
A copy constructor is invoked when:
i ➥ a function returns by value
ii ➥ an argument is passed by value
iii ➥ a function returns by reference
iv ➥ none of the above

Show Answer With Best Explanation

Answer: II
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q12➡ |
How many constructors can a class have?
i ➥ zero
ii ➥ 1
iii ➥ 2
iv ➥ any number

Show Answer With Best Explanation

Answer: IV
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line
Q13➡ |
Which of the following is true?
i ➥ A “static” member of a class cannot be inherited by its derived class.
ii ➥ A “static” member of a class can be initialized only within the class it is a member of.
iii ➥ A “static” member of a class can be initialized before an object of that class is created.
iv ➥ Since “static” member of a class is actually a global element, it does not require a class/object qualifier to access it independently of class/object.

Show Answer With Best Explanation

Answer: III
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q14➡ |
What keyword in class specification helps to hide data:
i ➥ Public
ii ➥ Private
iii ➥ Static
iv ➥ Void

Show Answer With Best Explanation

Answer: II
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q15➡ |
Data members and member function of a class by default is respectively:
i ➥ private and public
ii ➥ public
iii ➥ public and private
iv ➥ private

Show Answer With Best Explanation

Answer: IV
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q16➡ | Match the following with respect to I/O classes in object
oriented programming :
List – I List – II
a. fopen() i. returns end of file
b. fclose() ii. return for any problem report
c. ferror() iii. returns 0
d. feof() iv. returns a file pointer
Codes :
a,b,c,d
i ➥ iv i ii iii
ii ➥ iii i iv ii
iii ➥ ii iii iv i
iv ➥ iv iii i ii

Show Answer With Best Explanation

Answer: I
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q17➡ |
Which one of the following is correct, when a class grants friend status to another class?
i ➥ The member functions of the class generating friendship can access the members
of the friend class.
ii ➥ All member functions of the class granted friendship have unrestricted access to
the members of the class granting the friendship.
iii ➥ Class friendship is reciprocal to each other
iv ➥ There is no such concept.

Show Answer With Best Explanation

Answer: II
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q18➡ |
When a method in a subclass has the same name and type signatures as a method in the super-class, then the method in the subclass ……………… the method in the super-class.
i ➥ Overloads
ii ➥ Friendships
iii ➥ Inherits
iv ➥ Overrides

Show Answer With Best Explanation

Answer: IV
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q19➡ |
A …………….. is a special method used to initialize the instance variable of a class.
i ➥ Member function
ii ➥ Destructor
iii ➥ Constructor
iv ➥ Structure

Show Answer With Best Explanation

Answer: III
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q20➡ |
Encapsulation is
i ➥ Dynamic binding
ii ➥ A mechanism to associate the code and data.
iii ➥ Data abstraction
iv ➥ Creating new class

Show Answer With Best Explanation

Answer: II
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q21➡ |
Assume that we have constructor function for both Base and Derived classes. Now consider the declaration :
main ( )
Base *p = new Derived;
In what sequence, the constructor will be executed?
i ➥ Derived class constructor is followed by Base class constructor.
ii ➥ Base class constructor is followed by Derived class constructor.
iii ➥ Base class constructor is never called.
iv ➥ Derived class constructor is never called.

Show Answer With Best Explanation

Answer: II
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q22➡ |
Match the following interfaces of Java. Servlet package :
List – I
a. Servlet Config
b. Servlet Context
c. Servlet Request
d. Servlet Response
List – II
i. Enables Servlets to log events
ii. Read data from a client
iii. Write data to a client
iv. To get initialization parameters
Codes :
a b c d
i ➥ ii iv ii i
ii ➥ iii ii iv i
iii ➥ ii iii iv i
iv ➥ iv i ii iii

Show Answer With Best Explanation

Answer: IV
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q23➡ |
The pure object oriented programming language with extensive metadata available and modifiable at run time is
i ➥ Small talk
ii ➥ C++
iii ➥ Java
iv ➥ Eiffel

Show Answer With Best Explanation

Answer: I
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q24➡ |
Which method is called first by an applet program ?
i ➥ start( )
ii ➥ run( )
iii ➥ init( )
iv ➥ begin( )

Show Answer With Best Explanation

Answer: III
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q25➡ |
What is true about UML stereotypes ?
i ➥ Stereotype is used for extending the UML language.
ii ➥ Stereotyped class must be abstract
iii ➥ The stereotype indicates that the UML element cannot be changed
iv ➥ UML profiles can be stereotyped for backward compatibility

Show Answer With Best Explanation

Answer: I
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q26➡ |
Converting a primitive type data into its corresponding wrapper class object instance is called
i ➥ Boxing
ii ➥ Wrapping
iii ➥ Instantiation
iv ➥ Autoboxing

Show Answer With Best Explanation

Answer: IV
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q27➡ |
Which one of the following is correct?
i ➥ Java applets cannot be written in any programming language
ii ➥ An applet is not a small program.
iii ➥ An applet can be run on its own.
iv ➥ Applets are embedded in another applications.

Show Answer With Best Explanation

Answer: IV
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q28➡ |
In Java, when we implement an interface method, it must be declared as:
i ➥ Private
ii ➥ Protected
iii ➥ Public
iv ➥ Friend

Show Answer With Best Explanation

Answer: III
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q29➡ |
Which of the following is/are correct with reference to Abstract class and interface ?
(a) A class can inherit only one Abstract class but may inherit several interfaces.
(b) An Abstract class can provide complete and default code but an interface has no code.
Codes :
i ➥ a) is true
ii ➥ (b) is true
iii ➥ Both (a) and (b) are true
iv ➥ Neither (a) nor (b) is true

Show Answer With Best Explanation

Answer: III
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q30➡ |
Match the following with reference to object oriented
modelling :
List – I List – II
(a) Polymorphism (i) Picking both operator and attributes with operations appropriate to model an object
(b) Inheritance (ii) Hiding implementation details of methods from users of objects
(c) Encapsulation (iii) Using similar operations to do similar things
(d) Abstraction (iv) Create new classes from existing class
Codes :
(a) (b) (c) (d)
i ➥ iv) (iii) (i) (ii)
ii ➥ (iii) (iv) (i) (ii)
iii ➥ (iii) (i) (ii) (iv)
iv ➥ iv) (iii) (ii) (i)

Show Answer With Best Explanation

Answer: II
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q31➡ |
Which of the following is used to make an Abstract class ?
i ➥ Making atleast one member function as pure virtual function
ii ➥ Making atleast one member function as virtual function
iii ➥ Declaring as Abstract class using virtual keyword
iv ➥ Declaring as Abstract class using static keyword

Show Answer With Best Explanation

Answer: I
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q32➡ |
When one object reference variable is assigned to another object reference variable then
i ➥ a copy of the object is created.
ii ➥ a copy of the reference is created.
iii ➥ a copy of the reference is not created.
iv ➥ it is illegal to assign one object reference variable to another object reference variable.

Show Answer With Best Explanation

Answer: II
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q33➡ |
Which of the following statements is correct?
i ➥ Every class containing abstract method must not be declared abstract.
ii ➥ Abstract class cannot be directly initiated with ‘new’ operator.
iii ➥ Abstract class cannot be initiated.
iv ➥ Abstract class contains definition of implementation.

Show Answer With Best Explanation

Answer: II,III
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q34➡ |
Which of the following statements is correct?
i ➥ Aggregation is a strong type of association between two classes with full ownership.
ii ➥ Aggregation is a strong type of association between two classes with partial ownership.
iii ➥ Aggregation is a weak type of association between two classes with partial ownership.
iv ➥ Aggregation is a weak type of association between two classes with full ownership.

Show Answer With Best Explanation

Answer: III
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q35➡ |
It is possible to define a class within a class termed as nested class. There are ………… types of nested classes.
i ➥ 2
ii ➥ 3
iii ➥ 4
iv ➥ 5

Show Answer With Best Explanation

Answer: I,III
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q36➡ |
Implicit return type of a class constructor is:
i ➥ not of class type itself
ii ➥ class type itself
iii ➥ a destructor of class type
iv ➥ destructor not of class type

Show Answer With Best Explanation

Answer: II
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q37➡ |
Which of the following is not a correct statement?
i ➥ Every class containing abstract method must be declared abstract.
ii ➥ Abstract class can directly be initiated with ‘new’ operator.
iii ➥ Abstract class can be initiated.
iv ➥ Abstract class does not contain any definition of implementation.

Show Answer With Best Explanation

Answer: II
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q38➡ |
Constructors have …………. return type.
i ➥ void
ii ➥ char
iii ➥ int
iv ➥ no

Show Answer With Best Explanation

Answer: IV
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q39➡ |
Which of the following statement(s) with regard to an abstract class in JAVA is/are TRUE?
I. An abstract class is one that is not used to create objects.
II. An abstract class is designed only to act as a base class to be inherited by other classes.
i ➥ Only l
ii ➥ Only II
iii ➥ Neither I nor II
iv ➥ Both l and II

Show Answer With Best Explanation

Answer: IV
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q40➡ |
Consider the following JAVA program:
public class First
{
public static int CBSE(int x)
{
if (x < 100) x = CBSE (x +10);
return (x – 1);
}
public static void main(String[] args)
{
System.out.print(First.CBSE(60));
}
}
What does this program print?
i ➥ 59
ii ➥ 95
iii ➥ 69
iv ➥ 99

Show Answer With Best Explanation

Answer: IV
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q41➡ |
i ➥ 20:20
ii ➥ 18:18
iii ➥ 18:20
iv ➥ 20:18

Show Answer With Best Explanation

Answer: III
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q42➡ |
The goal of operator overloading is
i ➥ to help the user of a class
ii ➥ to help the developer of a class
iii ➥ to help define friend function
iv ➥ None of the above

Show Answer With Best Explanation

Answer: I
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q43➡ |
A friend function can be used to
i ➥ avoid arguments between classes.
ii ➥ allow access to classes whose source code is unavailable
iii ➥ allow one class to access an unrelated class.
iv ➥ None of the above

Show Answer With Best Explanation

Answer: III
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q44➡ |
A function object:
i ➥ is an instance of a class for which operator () is a member function.
ii ➥ is an instance of a class for which operator → is a member function.
iii ➥ is a pointer to any function
iv ➥ is a member function of a class

Show Answer With Best Explanation

Answer: I
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q44➡ |
If a data-item is declared as a protected access specifier then it can be accessed:
i ➥ Anywhere in the program
ii ➥ By the base and derived classes
iii ➥ Only by base class
iv ➥ Only by derived class

Show Answer With Best Explanation

Answer: II
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q45➡ |
Runtime polymorphism can be achieved by:
i ➥ Accessing virtual function through the pointer of the base class
ii ➥ Accessing virtual function through the object
iii ➥ The derived class
iv ➥ None of these

Show Answer With Best Explanation

Answer: I
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q46➡ |
The friend functions are used in situations where:
i ➥ We want to have access to unrelated classes
ii ➥ Dynamic binding is required
iii ➥ Exchange of data between classes to take place
iv ➥ None of the above

Show Answer With Best Explanation

Answer: III
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q47➡ |
Encapsulation is
i ➥ Dynamic binding
ii ➥ A mechanism to associate the code and data.
iii ➥ Data abstraction
iv ➥ Creating new class

Show Answer With Best Explanation

Answer: II
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q48➡ |
A …………….. is a special method used to initialize the instance variable of a class.
i ➥ Member function
ii ➥ Destructor
iii ➥ Constructor
iv ➥ Structure

Show Answer With Best Explanation

Answer: III
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q49➡ |
When a method in a subclass has the same name and typesignatures as a method in the superclass, then the method in the subclass……………… the method in the superclass.

i ➥ Overloads
ii ➥ Friendships
iii ➥ Inherits
iv ➥ Overrides

Show Answer With Best Explanation

Answer: IV
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q50➡ |
Which one of the following is correct, when a class grants friend status to another class?
i ➥ The member functions of the class generating friendship can access the members of the friend class.
ii ➥ All member functions of the class granted friendship have unrestricted access to the members of the class granting the friendship.
iii ➥ Class friendship is reciprocal to each other
iv ➥ There is no such concept.

Show Answer With Best Explanation

Answer: II
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

error: Content is protected !!
Open chat
1
Hi,how Can We Help You ?