search
Log In

Recent questions tagged object-oriented-programming

0 votes
1 answer
1
Consider the following recursive Java function $f$ that takes two long arguments and returns a float value: public static float f (long m, long n) { float result = (float)m / (float)n; if (m < 0 ¦ n<0 return 0.0f; else result -=f(m*2, n*3); return result; } Which of the following real values best approximates the value of $f(1,3)$? $0.2$ $0.4$ $0.6$ $0.8$
asked Nov 20, 2020 in Object Oriented Programming jothee 52 views
0 votes
1 answer
2
0 votes
1 answer
4
0 votes
1 answer
7
0 votes
1 answer
8
0 votes
2 answers
9
Give the output #include<iostream> using namespace std; class Base { public: int x,y; public: Base(int i, int j){x=i;y=j;} }; class Derived:public Base { public: Derived(int i,int j):x(i),y(j){} void print(){cout<< x << ""<<y ;} }; int main(void) { Derived q(10,10); q.print(); return 0; } $10\:10$ Compiler Error $0\:0$ None of the option
asked Mar 30, 2020 in Object Oriented Programming Lakshman Patel RJIT 192 views
1 vote
2 answers
10
Give the output #include<iostream> using namespace std; class Base1{ public: ~Base1() {cout<<"Base1's destructor"<<endl;} }; class Base2 { public: ~Base2(){cout<<"Base2's destructor"<<endl;} }; class Derived : public Base1,public Base2{ ... destructor Base$2$'s destructor Derived's Destructor Derived's Destructor Base$2$'s destructor Base$1$'s destructor Derived's Destructor Compiler Dependent
asked Mar 30, 2020 in Object Oriented Programming Lakshman Patel RJIT 206 views
0 votes
1 answer
11
Abstraction and encapsulation are fundamental principles that underlie the object oriented approach to software development. What can you say about the following two statements? Abstraction allows us to focus on what something does without considering the complexities of how it works. Encapsulation ... us. Neither I nor II is correct Both I and II are correct Only II is correct Only I is correct
asked Mar 24, 2020 in Object Oriented Programming jothee 201 views
0 votes
1 answer
12
Given the array of integers ‘array’ shown below: $\begin{array}{|c|c|c|c|c|c|c|c|c|c|} \hline 13 & 7 & 27 & 2 & 18 & 33 & 9 & 11 & 22 & 8 \\ \end{array}$ What is the output of the following JAVA statements? int[]p= new int [10]; int[]q= new int [10]; for ( int k=0; k<10; k++) p[k]= array [k]; q=p; p[4]=20; System.out.println(array[4]+":"+q[4]); $20:20$ $18:18$ $18:20$ $20:18$
asked Mar 24, 2020 in Object Oriented Programming jothee 181 views
0 votes
2 answers
13
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? $59$ $95$ $69$ $99$
asked Mar 24, 2020 in Object Oriented Programming jothee 257 views
0 votes
1 answer
14
Which of the following statement(s) with regard to an abstract class in JAVA is /are TRUE ? An abstract class is one that is not used to create objects An abstract class is designed only to act as a base class to be inherited by other classes Only I only II Neither I nor II Both I and II
asked Mar 24, 2020 in Object Oriented Programming jothee 341 views
0 votes
2 answers
15
Which of the following cannot be passed to a function in C++? Constant Structure Array Header file
asked Mar 24, 2020 in Object Oriented Programming jothee 350 views
0 votes
1 answer
16
Which one of the following is correct for overloaded functions in $C++$? Compiler sets up a separate function for every definition of function. Compiler does not set up a separate function for every definition of function. Overloaded functions cannot handle different types of objects. Overloaded functions cannot have same number of arguments.
asked Mar 24, 2020 in Object Oriented Programming jothee 208 views
0 votes
1 answer
17
Which of the following operators cannot be overloaded in $C/C++$ ? Bitwise right shift assignment Address of Indirection Structure reference
asked Mar 24, 2020 in Object Oriented Programming jothee 120 views
0 votes
1 answer
18
The diagramming language suitable for object-oriented paradigm is Data Flow Diagramming Language Entity-Relationship Language Object-Oriented Language Unified Modeling Language
asked Aug 4, 2019 in Object Oriented Programming gatecse 88 views
0 votes
0 answers
19
Object-oriented paradigm is used in the analysis stage of SDLC to Structure the behavioural part of the business process Design the structural part of Computer memory Design the object-oriented programming language Design the structure of the database.
asked Aug 4, 2019 in Object Oriented Programming gatecse 34 views
0 votes
0 answers
20
The signature of the object method clause present in class diagram contains All definitional attributes of the class used in the method All referential attributes of the class/es used in the method All definitional attributes of related classes All attributes of related classes
asked Aug 4, 2019 in Object Oriented Programming gatecse 49 views
0 votes
3 answers
22
In Java, which of the following statements is/are TRUE? S1: The final' keyword applied to a class definition prevents the class form being extended through derivation S2: A class can only inherit one class but can implement multiple interfaces S3: Java permits a class to replace the ... . It is called method overloading Code: S1 and S2 only S1 and S3 only S2 and S3 only All of S1, S2 and S3
asked Jul 13, 2018 in Object Oriented Programming Pooja Khatri 819 views
1 vote
0 answers
23
Give a simple example on inheriting the operator function and using it in programme
asked Apr 22, 2018 in Object Oriented Programming anonymous 112 views
0 votes
0 answers
24
why did constructor's name is same as class name and it has no return type
asked Mar 21, 2018 in Object Oriented Programming kd..... 116 views
0 votes
1 answer
25
Which of the following is not correct (in C++)? 1) Class templates and function templates are instantiated in the same way. 2) Class templates differ from function templates in the way they are initiated. 3) Class templates is initiated by defining an object using the template argument. 4) Class templates are generally used for storage classes.
asked Nov 9, 2017 in Object Oriented Programming Devwritt 1.6k views
0 votes
1 answer
26
Which of the following is true? (A) A static member of a class cannot be inherited by its derived class. (B) A static member of a class can be initialized only within the class it is a member of. (C) A static member of a class can be ... 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.
asked Sep 27, 2017 in Object Oriented Programming rishu_darkshadow 378 views
0 votes
2 answers
27
0 votes
1 answer
28
When a language has the capability to produce new data types, it is said to be : extensible encapsulated overloaded none of the above
asked Sep 26, 2017 in Object Oriented Programming rishu_darkshadow 434 views
0 votes
1 answer
29
A copy constructor is invoked when : a function returns by value an argument is passed by value a function returns by reference none of the above
asked Sep 26, 2017 in Object Oriented Programming rishu_darkshadow 664 views
0 votes
2 answers
30
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. (A) I, II, III (B) II, III, V (C) III, IV, V (D) I, II, IV
asked Sep 17, 2017 in Programming rishu_darkshadow 1.5k views
...