Programming Languages NTA UGC NET Question Analysis

Programming Languages NTA UGC NET Question Analysis


Q1➡ | NET December 2022
Consider the following conditional code , which returns a Boolean values
If((x>25) && (y>100))
return ‘false’;
else if((x <= 25) && (y<=100))
return ‘true’;
else if((x>25) && (y<=100))
return ‘false’;
else
return ‘true’;
Simplify it by filling in the following blank with a single Boolean expression without changing the behavior of the conditional code.
If (………………..)
return ‘true’;
else
return ‘false’;
i ➥ X>25
ii ➥ X≤25
iii ➥ Y>100
iv ➥ Y≤100
Best Explanation:
Answer: (ii)
Explanation: Upload Soon
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q2➡ | NET December 2022
Machine Level Language is a/an
i ➥ Assembly Language
ii ➥ Low Level Language
iii ➥ High Level Language
iv ➥ Translating Language
Best Explanation:
Answer: (ii)
Explanation: Upload Soon
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q3➡ | NET December 2022
Which of the following is wrong about the data types?
i ➥ The number is always positive when qualifier ‘unsigned’ is used.
ii ➥ The number can be positive or negative when the qualifier ‘signed’ is used
iii ➥ The range of value for signed data types is more than that of unsigned data types
iv ➥ The left most bit in unsigned data type is used to represent the value
Best Explanation:
Answer: (iii)
Explanation: Upload Soon
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q4➡ | NET December 2022
If a constructor ‘Date’ is declared explicitly and has to be defined outside the class. Which of the following is correct?
i ➥ Date :: Date (int dd) {/*……*/}
ii ➥ Explicit Date :: Date (int dd) {/*…..*/}
iii ➥ Such a constructor cannot be defined
iv ➥ Constructor always has be defined inside the class
Best Explanation:
Answer: (i)
Explanation: Upload Soon
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q5➡ |
Let ‘n’ denote a positive integer. Suppose a function F is defined as
i ➥ 4, ⌊log2n⌋
ii ➥ 14, ⌊log2n⌋
iii ➥ 4, ⌊n/2⌋
iv ➥ 14, ⌊n/2⌋
Best Explanation:
Answer: (i)
Explanation: Upload Soon
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q6➡ | NET December 2022
Which of the following lists define in HTML Share similar elements?
(A) Unordered lists
(B) Ordered List
(C) Definition List
(D) Correlated List
(E) Enumerated lists
Choose the appropriate answer from the options given below:
i ➥ A, B, D only
ii ➥ A,  C, E only
iii ➥ A,  B, C only
iv ➥ A, C, D only
Best Explanation:
Answer: Mark to All
Explanation: Upload Soon
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q7➡ | NET December 2022
Match List (I) with List (II)
A.	If the implementation of generated or derived classes differ only through a param
eter we have	I.	To use class hierarchy

B.	If the actual types of objects used cannot be known at compile time, then we have	II.	Improved run-time efficiency

C. 	If inline operations are essential and templates are used then we have 	III.	To use templates

D. 	To gain access to differing instances for derived classes through base we have 	IV.	To use explicit casting
Choose the correct answer from the options given below:
i ➥ A-(I), B-(II), C-(IV), D-(III)
ii ➥ A-(III), B-(I), C-(II), D-(IV)
iii ➥ A-(I), B-(III), C-(II), D-(IV)
iv ➥ A-(II), B-(I), C-(III), D-(IV)
Best Explanation:
Answer: (ii)
Explanation: Upload Soon
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q8➡ | NET December 2022
Match List (I) with List (II)
A.	 Apache Kafka	I.	Platform for constructing data flows for extract, transform, and load (ETL) processing and analysis of large datasets. 
B.	 Pig	II.	General–purpose computing model and runtime system for distributed data analytics.
C. 	 Apache Mahout	III.	Open-Source platform that was created by LinkedIn. 
D. 	 Map reduce	IV.	Open-Source platform used for creating scalable machine learning algorithms.
Choose the correct answer from the options given below:
i ➥ A-(II), B-(IV), C-(I), D-(III)
ii ➥ A-(II), B-(I), C-(IV), D-(III)
iii ➥ A-(III), B-(I), C-(IV), D-(II)
iv ➥ A-(I), B-(II), C-(IV), D-(III)
Best Explanation:
Answer: (iii)
Explanation: Upload Soon
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q9➡ | NET December 2022
In what sequence the initialization, testing and execution of body is done while using do while loop?
(A) Commenting
(B) Execution of the body
(C) Initialization
(D) Testing the condition
Choose the correct answer from the following:
i ➥ D,B,C
ii ➥ D,C,B
iii ➥ C,A,B
iv ➥ C,B,D
Best Explanation:
Answer: (iv)
Explanation: Upload Soon
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q10➡ | NET June 2022
Match List (I) with List (II) :
(A)	Localization	(I)	Encapsulation

(B)	Packaging or binding of a collection of item
	(II)	Abstraction
(C)	Mechanism that enables designer to focus on essential details of a program Component. 		(III)	Characteristics of software that indicates the manner in which information is concentrated in program. 

(D)	Information hiding	(IV)	Suppressing the operational details of a
Program component
Choose the correct answer from the options given below:
i ➥ (A)-(I),(B)-(II),(C)-(III),(D)-(IV)
ii ➥ (A)-(II),(B)-(I),(C)-(III),(D)-(IV)
iii ➥ (A)-(III),(B)-(I),(C)-(II),(D)-(IV)
iv ➥ (A)-(III),(B)-(I),(C)-(IV),(D)-(II)
Best Explanation:
Answer: (iii)
Explanation: Upload Soon
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q11➡ | NET June 2022
pointers cannot be used to
i ➥ Find the address of a variable in memory         
ii ➥ Reference value directly
iii ➥ Simulate dynamic data structure
iv ➥ Manipulate dynamic data structure
Best Explanation:
Answer: (ii)
Explanation: Upload Soon
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q12➡ | NET June 2022
The condition num!=65 cannot be replaced by
i ➥ num>65 | | num < 65
ii ➥ !(num = = 65)
iii ➥ num – 65
iv ➥ !(num – 65)
Best Explanation:
Answer: (iv)
Explanation: Upload Soon
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q13➡ | NET June 2022
Of the following, which is Not a logical error?
i ➥ Using the ‘=’ , instead of ‘==’ to determine if two values are equal
ii ➥ Divide by Zero
iii ➥ Failing to initialize counter and total variables before the body of loop
iv ➥ Using commas instead of two required semicolon in a for loop header
Best Explanation:
Answer: (iv)
Explanation: Upload Soon
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q14➡ | NET June 2022
Which mechanism in XML allows organizations to specify globally unique names as element tags in documents?
i ➥ Root
ii ➥ Header
iii ➥ Schema
iv ➥ Namespace
Best Explanation:
Answer: (iv)
Explanation: Upload Soon
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q15➡ | NET June 2022
Which statement is false?
i ➥ All function calls in C pass arguments using call by value
ii ➥ Call by reference enables a called function to modify a variable in calling function
iii ➥ Call by value always more efficient that call by reference
iv ➥ Programmers use pointers and indirection operation to simulate call by references
Best Explanation:
Answer: (iii)
Explanation: Upload Soon
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q16➡ | NET June 2022
A top down approach to programming calls for :
Statement (I) : Working from the general to the specific
Statement (II) : Postpone the minor decisions
Statement (III) : A systematic approach
Statement (IV) Intermediate coding of the problem
Which of the following is true ?
i ➥ Statement (I) only
ii ➥ Statement (I) and Statement (II) only
iii ➥ Statement (I) , Statement (II) and Statement (III) only
iv ➥ Statement (I) , Statement (II) and Statement (IV) only
Best Explanation:
Answer: (iii)
Explanation: Upload Soon
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

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 ?