Programming Languages NTA UGC NET Question Analysis

Programming Languages NTA UGC NET Question Analysis


Q.1➡ | UGC NET DEC 2023
Given below are two statements:
Statement (I): The friend function and the member functions of a friend class directly access the private and protected data.
Statement (II): The friend function can access the private data through the member functions of the base class
In the light of the above statements, choose the most appropriate answer from the options given below:
i ➥ Both Statement I and Statement II are correct
ii ➥ Both Statement I and Statement II are incorrect
iii ➥ Statement I is correct but Statement II is incorrect
iv ➥ Statement I is incorrect but Statement II is correct
Best Explanation:
Answer: (IV)
Explanation: Upload Soon
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q.2➡ | UGC NET DEC 2023
Which of the following statements is TRUE?
i ➥ Virtual functions do not implement polymorphism
ii ➥ Virtual functions do not permit calling of derived class functions using a base class pointer
iii ➥ We can never build an object from a class containing a pure virtual function
iv ➥ Pure virtual functions can never have a body
Best Explanation:
Answer: (III)
Explanation: Upload Soon
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q.3➡ | UGC NET DEC 2023
Which of the statement are CORRECT ?
(A) Constructors are invoked automatically when the objects are created.
(B) Constructors do not have return types, not even void and therefore they cannot return values.
(C) Constructors cannot be inherited though a derived class can call the base class constructors.
(D) Constructors can be declared as virtual.
Choose the correct answer from the options given below :
i ➥ (A), (B) and (D) Only
ii ➥ (A), (B) and (C) Only
iii ➥ (B), (C) and (D) Only
iv ➥ (A), (C) and (D) Only
Best Explanation:
Answer: (II)
Explanation: Upload Soon
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line


Q.4➡ | UGC NET DEC 2023
What is the output of the following program?
#include
#define SQR(x) (x*x)
int main ()
{ int a, b = 3;
a = SQR(b+2);
printf(“%d”,a);
return 0;
}
i ➥ 25
ii ➥ 11
iii ➥ Garbage value
iv ➥ 24
Best Explanation:
Answer: (II)
Explanation: Upload Soon

More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q.5➡ | UGC NET DEC 2023
What is the output of the following program?
include
int main()
{ int i=3;
while (i–)
{ int i=10;
i–;
printf(“%d”, i);
}
printf(“%d”, i);
}
i ➥ 990
ii ➥ 9990
iii ➥ 999-1
iv ➥ 99-1
Best Explanation:
Answer: (III)
Explanation: Upload Soon
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line


Q.6➡ | UGC NET DEC 2023
Consider the following code segment:
int arr[] = {0, 1, 2, 3, 4};
int i = 1, *ptr;
ptr = arr + 2;
arrange the following printf statements in the increasing order of their output.
(A) printf (“%d”, ptr[i]);
(B) printf (“%d”, ptr[i+1]);
(C) printf (“%d”, ptr[-i]);
(D) printf (“%d”, ptr[-i+1]);
Choose the correct answer from the options given below :
i ➥ (C), (A), (B), (D)
ii ➥ (C), (D), (A), (B)
iii ➥ (D), (A), (B), (C)
iv ➥ (A), (B), (D), (C)
Best Explanation:
Answer: (II)
Explanation: Upload Soon
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line


Q.7➡ | UGC NET JUNE 2023
What is the output of following code?
What is the output of following code?
1.	main ()
2.	{ 
3.	static float a[]={13.24,1.5,4.5,5.4,3.5}
4.	float * j, * k;
5.	j= a};
6.	k= a + 4
7.	j=j * 2;
8.	k = k / 2;
9.	printf ("% f % f",* j,*k);
10.	}
i ➥ 13.25,4.5
ii ➥ 1.5,3.5
iii ➥ 13.24,1.5,4.5,5.4,3.5
iv ➥ Illegal use of pointer in main function
Best Explanation:
Answer: IV
Explanation: Upload Soon
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line
UGC NET Computer Science June 2023 Previous Year Question with Solution

Q.8➡ |UGC NET JUNE 2023
What will be the output of the following code? What will be the output of the following code?
What will be the output of the following code? What will be the output of the following code?
1.	# include<stdio.h>
2.	int main() 
3.	{
4.	int a, b, c;
5.	a=ox10; b=010;
6.	c=a+b;
7.	printf (“%d”, c);
8.	return 0;
9.	}
 
A.	20
B.	24
C.	Garbage
D.	error
i ➥ 20
ii ➥ 24
iii ➥ Garbage
iv ➥ Error
Best Explanation:
Answer: ii
Explanation:
a = 0x10 → 10 in hexadecimal = 16 in Decimal
b = 010 → 10 in octal = 8 in decimal
c = a+b = 16+8 = 24
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q.9➡ | UGC NET JUNE 2023
What is x in the following program?

# include < stdio.h >
int main ( )
{
typedef (*( *arrfptr[3])())[10];
arrfptr x ;
return 0 ;
}
i ➥ x is a pointer
ii ➥ x is a array of three pointer
iii ➥ x is an array of three function pointer
iv ➥ Error in x declaration
Best Explanation:
Answer: III
Explanation: Upload Soon
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q.10➡ | UGC NET JUNE 2023
In the standard Ethernet with transmission rate of 10Mbps, asssume that the length of the medium is 2500 m and size of a frame is 512 bytes. The propagation speed of a signal in a cable is normally 2 * 10 ^ 8 * m / s The transmission delay and propogation delay are.
i ➥ 25.25μs and 51.2μs
ii ➥ 51.2μs and 12.5μs
iii ➥ 10.24μs and 50.12μs
iv ➥ 12.5μs and 51.2μs
Best Explanation:
Answer: II
Explanation: Upload Soon
More DiscussionExplanation On YouTubeLearn Topic WiseHelp-Line

Q.11➡ | 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

Q.12➡ | 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

Q.13➡ | 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

Q.14➡ | 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

Q.15➡ |
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

Q.16➡ | 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

Q.17➡ | 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

Q.18➡ | 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

Q.19➡ | 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

Q.20➡ | 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

Q.21➡ | 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

Q.22➡ | 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

Q.23➡ | 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

Q.24➡ | 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

Q.25➡ | 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

Q.26➡ | 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

Q.27➡ |
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

Q.28➡ |
‘*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

Q.29➡ |
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

Q.30➡ |
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

Q.31➡ |
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

Q.32➡ |
……………… 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

Q.33➡ |
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

Q.34➡ |
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

Q.35➡ |
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

Q.36➡ |
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

Q.37➡ |
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

Q.38➡ |
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
Q.39➡ |
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

Q.40➡ |
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

Q.41➡ |
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

Q.42➡ | 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

Q.43➡ |
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

Q.44➡ |
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

Q.45➡ |
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

Q.46➡ |
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

Q.47➡ |
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

Q.48➡ |
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

Q.49➡ |
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

Q.50➡ |
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

Q.51➡ |
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

Q.52➡ |
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

Q.53➡ |
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

Q.54➡ |
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

Q.55➡ |
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

Q.56➡ |
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

Q.57➡ |
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

Q.58➡ |
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

Q.59➡ |
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

Q.60➡ |
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

Q.61➡ |
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

Q.62➡ |
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

Q.63➡ |
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

Q.64➡ |
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

Q.65➡ |
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

Q.66➡ |
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

Q.67➡ |
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

Q.68➡ |
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

Q.69➡ |
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

Q.70➡ |
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

Q.71➡ |
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

Q.72➡ |
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

Q.73➡ |
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

Q.74➡ |
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

Q.75➡ |
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

Q.76➡ |
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

Q.77➡ |
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 ?