search
Log In
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

Recent questions and answers in Object Oriented Programming

0 votes
1 answer
1
Which of the following is not true in C++ ? Private elements of a base class are not accessible by members of its derived class. Protected elements of base class are not accessible by members of its derived class. When base class access specified is ... derived class. When base class access specified is Public , protected elements of a base class become protected members of its derived class.
answered Aug 23 in Object Oriented Programming nocturnal123 54 views
1 vote
2 answers
2
which of the following can not be declared static ? a)class b)object c)functions d)member variables
answered Aug 9 in Object Oriented Programming the_psycho_scientist 1.2k views
0 votes
1 answer
3
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.
answered Aug 9 in Object Oriented Programming the_psycho_scientist 327 views
0 votes
1 answer
5
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$
answered Aug 9 in Object Oriented Programming the_psycho_scientist 130 views
0 votes
1 answer
6
Which of the following is true of constructor function in C++ ? A class must have at least one constructor. A constructor is a unique function which cannot be overloaded. A constructor function must be invoked with the object name. A constructor function is automatically invoked when an object is created.
answered Aug 9 in Object Oriented Programming the_psycho_scientist 34 views
1 vote
2 answers
7
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
answered Aug 9 in Object Oriented Programming the_psycho_scientist 93 views
0 votes
2 answers
8
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
answered Aug 9 in Object Oriented Programming the_psycho_scientist 92 views
0 votes
1 answer
9
0 votes
1 answer
10
Which of the following object types are generally autonomous, meaning that they can exhibit some behavior without being operated upon by another object. Passive Active Both (A) and (B) None of the mentioned
answered Jun 6 in Object Oriented Programming Ollie 50 views
0 votes
2 answers
11
0 votes
1 answer
12
In a system for a restaurant the main scenario for placing order is given below: Customer reads menu Customer places order Order is sent to kitchen for preparation Order items are served Customer request for a bill for the order Bill is prepared for this order Customer is given the bill ... will have at least how many objects among whom the messages will be exchanged) 1) 3 (2) 4 (3) 5 (4) 6
answered May 16 in Object Oriented Programming Sangita B 500 views
0 votes
1 answer
15
0 votes
2 answers
19
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$
answered Mar 26 in Object Oriented Programming abhishekmehta4u 162 views
0 votes
0 answers
20
Polymorphism means : A template function Runtime type identification within a class hierarchy Another name for operator overloading Virtual inheritance
asked Mar 26 in Object Oriented Programming jothee 34 views
0 votes
1 answer
21
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 in Object Oriented Programming jothee 150 views
0 votes
1 answer
22
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 in Object Oriented Programming jothee 125 views
0 votes
1 answer
23
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 in Object Oriented Programming jothee 56 views
0 votes
1 answer
24
Which of the following operators cannot be overloaded in $C/C++$ ? Bitwise right shift assignment Address of Indirection Structure reference
asked Mar 24 in Object Oriented Programming jothee 79 views
13 votes
5 answers
25
It is desired to design an object-oriented employee record system for a company. Each employee has a name, unique id, and salary. Employees belong to different categories and their salary is determined by their category. The functions get name, getId and compute salary are required. Given the class ... the subclass Choose the best design I, IV, VI, VIII I, IV, VII I, III, V, VI, VIII II, V, VIII
answered Mar 20 in Object Oriented Programming immanujs 3.1k views
5 votes
2 answers
26
Consider the class of object oriented languages. Which of the following is true? Pascal is an object oriented language. Object oriented languages require heap management. Object oriented languages cannot be implemented in language C. Object oriented languages are more powerful than declarative programming languages. Parallelism cannot be realized in object oriented languages.
answered Feb 27 in Object Oriented Programming JashanArora 397 views
1 vote
1 answer
27
Consider the following C++ function f(): unsigned int f(unsigned int n) { unsigned int b=0; while (n) { b+=n & 1; n>>1; } return b; } The function f() returns the int that represents the ____P____ in the binary representation of positive integer n, where P is number of $0$’s number of bits number of consecutive $1$’s number of $1$’s
answered Jul 2, 2019 in Object Oriented Programming srestha 617 views
0 votes
3 answers
28
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
answered Nov 22, 2018 in Object Oriented Programming mahesh13 698 views
0 votes
1 answer
29
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.
answered Nov 2, 2018 in Object Oriented Programming Kuljeet Shan 1.4k views
0 votes
0 answers
30
In C++ and java which of the following features is not essential for polymorphic behaviour of programs? A) Inheritance B) Method overriding C) Method overloading D) Encapsulataion The question was asked in GSET 2018(Gujarat State Eligibilty Test ). According to the answer key , Option C is correct, but How? Isn't Method overloading a
asked Oct 13, 2018 in Object Oriented Programming sherlock_john 89 views
2 votes
3 answers
31
Which of the following, in C++, is inherited in a derived class from base class? constructor destructor data members virtual methods
answered Jun 25, 2018 in Object Oriented Programming Prasanjeet Ghosh 1.3k views
0 votes
0 answers
32
If vtable is array vtable [] = {funptr1,funptr2,funptr3}; than how did its size is 4 bytes (64 bit compiler)
asked Jun 3, 2018 in Object Oriented Programming kd..... 40 views
2 votes
1 answer
33
The Servlet Response interface enables a servlet to formulate a response for a client using the method void log(Exception e, String s) void destroy() int get ServerPort() void set ContextType(String Type)
answered May 28, 2018 in Object Oriented Programming chetanmcs 1.1k views
0 votes
2 answers
34
The syntax of capturing events method for document object is CaptureEvents() CaptureEvents(Orgs eventType) CaptureEvents(eventType) CaptureEvents(eventVal)
answered May 19, 2018 in Object Oriented Programming Prasanjeet Ghosh 581 views
0 votes
0 answers
35
Please explain the working of this code:- #include<iostream> using namespace std; class Base { public: int x; Base():x(10){} ~Base(){} }; class Derived:public Base { public: int y; Derived():y(20){} ~Derived(){} }; int main() { Base bobj,*bptr; Derived dobj,*dptr; bptr ... to derived members // dptr=(Derived*)&bobj; cout<<dptr->x<<endl; cout<<dptr->y<<endl; } Output:-10 10 0 [Finished in 2.7s]
asked May 12, 2018 in Object Oriented Programming kd..... 62 views
1 vote
0 answers
36
Give a simple example on inheriting the operator function and using it in programme
asked Apr 22, 2018 in Object Oriented Programming anonymous 100 views
0 votes
1 answer
37
If I allocate the memory using new operator to member in constructor I.e dynamic constructor than should I have to write delete in destructor
answered Apr 13, 2018 in Object Oriented Programming Kshitij Vengurlekar 45 views
0 votes
0 answers
38
why did in conversion of class to basic the type conversion operator does not have return type and argument as void
asked Apr 10, 2018 in Object Oriented Programming kd..... 72 views
1 vote
0 answers
39
On overloading pre increment and post increment why compiler taking dummy value only for post increment and not in pre increment
asked Apr 6, 2018 in Object Oriented Programming kd..... 104 views
7 votes
3 answers
40
Which of the following operator(s) cannot be overloaded? .(member Access or Dot operator) ?: (ternary or Conditional Operator) :: ( Scope Resolution Operator) All of the above
answered Mar 13, 2018 in Object Oriented Programming pankaj_vir 3.1k views
To see more, click for all the questions in this category.
...