the class to be inherited privately. This is because the phone being a single unit b) Abstraction, Which among the following can be a concept against encapsulation rules? student s; Answer: d system that is highest level of abstraction as it hides everything inside. b) False, Encapsulation and abstraction differ as ____________ Explanation: If we use any kind of array or pointer as data member which should not be changed, but in some case its
Answer: a a) Copying the code already written c) Dennis Ritchie languages. d) Hiding and hiding respectively, In terms of stream and files ____________ Answer: a illustrated here only if any of these is applicable of being overloaded. d) String Class, Which of the following describes a friend class? a) Inheritance Y3?8 X|VtP'(q@KN@Q}*7q,%C\'x9$p^g0jh`NT3^UO>B c) Using object array b) At compile time 7b* tu Answer: b By this code we can get the address of the private member of the class, c) More than one method with same name, same signature, same number of parameters but different type class student { int rollno; char name[0]; static int studentno; }; Answer: c Actual devices are called file because in one way or another, those can be considered as single entity and there is c) By making their visibility mode as private in derived class d) Scope of an object, Who invented OOP? data and public access specifiers were present in structures too. c) Real d) Data is not sufficient to decide what is being used, A phone is made up of many components like motherboard, camera, sensors and etc. Answer: d a) Anonymous class Parameterized constructor a) SmallTalk d) Member functions can be used to change the data type of data members, Which feature can be implemented using encapsulation? Explanation: Abstraction principle includes use of abstraction to avoid duplication (usually of code). Explanation: We can define public member functions to access those private data members and get their value for use or Prototype must be different in base and derived class, Prototype must be same in base class and derived class, Prototype must be given only in base class, Prototype must have different signature in base and derived class. { Answer: d a) Data members c) 2 b) Derived class constructor a) True char name[0]; c) It is the ability for many messages/data to be processed in one way d) It does not support pointers, Class is _________ abstraction. c) Only 999 Answer: b So static variables size will not be added. a) Control and data d) Member functions can be made friend to another class using the friend keyword. Answer: a 2. destroyed as soon as the function is returned. c) Friend class dont have any implementation << b) Execution time polymorphism Which among the following is true for virtual functions? Now if we also have a global variable of same name as that of base class private variable, neither the global variable a) Overloading || d) A class which gets inherited by 2 classes. b) 1980s d) Increases overhead of function definition always, If 2 classes derive one base class and redefine a function of base class, also overload some operators inside class body. considered as property of a single object. If the processor represents all the b) It is the ability for a message/data to be processed in only 1 form, What do you call the languages that support classes but not polymorphism? Use of global variables also makes the program vulnerable, hence we cant say that encapsulation Answer: d Answer: a Among these two things of function and operator overloading, where is polymorphism used? b) Member functions Read documents to start getting recommendations. nothing hidden. Nederlnsk - Frysk, Marketing-Management: Mrkte, Marktinformationen und Marktbearbeit, Auditing and Assurance Services: an Applied Approach. b) Using scope resolution operator How are abstract functions different from the abstract functions? In this way we simulate the functions like For example, we directly use cout object in C++ but we dont know b) Final Class Answer: a Answer: a It was instance because it will have implementation of all members. Scope resolution operator is used to access globally declared variables/objects. Explanation: False, because we cant call these structures if member functions are involved, it must be called class. It is a special class Explanation: Class is logical abstraction because it provides a logical structure for all of its objects. Explanation: The object declared in main() have local scope inside main() function only. b) Java done. c) Object can be used to call other class members a) Using function pointers a) Abstract Class But the multiple Being useless task, } public: studentsint i, int j{ Explanation: Any number of classes can be defined inside a program, provided that their names are different. a) Class and object a) A temporary object is created to return the value
public: void dsips class topper:public student b) Derived class must be of abstract type data and may add vulnerability in the program. Hence when /Registry (Adobe) 36 0 obj c) student s[2]={ s1(392,9), s2(222,5) }; d) class student{ student(int a){} }; Which of the following pairs are similar? Explanation: The class containing main function can be inherited and hence the program can be executed using the a) Motherboard public : calc_grades a) Using dot operator/period symbol Answer: b ensure the security of data and to maintain OOP features. Explanation: It is the way we can initialize the data members for an object array using parameterized constructor. c) This code will generate error Polymorphism is such an important feature, that is a language doesnt support this feature, it cant be called as a b) Encapsulation Answer: d Answer: a b) More than one method with same name, same signature but different number of signature a) Friend class can access all the private members of the class, of which it is a friend a) Compile time polymorphism F*0v{tukNf~]@"D @"D @"D @"D Wp
c ?D
vjj!!a6@;up'7Z Hence it is not mandatory to specify the access mode if we want It cant be called as parent or instance of an object. protected members of derived class in protected access mode. Kupdf - Solutions of Industrial Organization by Luis M Cabral. parent class. Answer: c d) Abstract class, Which among the following best describes encapsulation? %PDF-1.5 }, a) This code is good to go a) class student{ }; student s; That will give you permission to inherit the private members of base class. its constructor but the class is derived so first the base class must be initialized, hence in turn the base class constructor is b) By making their visibility mode as protected only c) It gets inherited privately by default c) A class inheriting a nested class Class in general describes all the properties of, Adele Goldberg was in team to develop SmallT. Which among the following best defines the abstract methods? d) Abstraction cant be defined in terms of files and stream, If two classes combine some private data members and provides public member functions to access and manipulate variables. c) SmallTalk d) It is a way of combining various data members and member functions that operate on those data members into a single Answer: c c) Class can have only member functions with no data members /Filter /FlateDecode c) Private members Answer: a d) student s[2]={ s[392,9], s2[222,5] }; Answer: b No polymorphism is used here. Answer: b can use those complex functions directly in the program. a) Classes may/may not have both data members and member functions Explanation: Only if the objects are of same class then their data can be copied from to another using assignment operator. program, it can be used anywhere, any number of times in a single program. c) Helps in redefining the same functionality } Answer: a The word polymorphism Answer: a a) Object { Explanation: Functions can always return an object if the return type is same as that of object being returned. We can use a) class student{ }s1,s2; s1()=s2(); #udn2hC&y9$ErpUXgutR~.vGne@qa{@"{^X }f@ NHH/ ?Ee>_3D @"D @"D @"D UUZ4^Z&5]7Canl?;8. b) C++ ]JaN9|]:N^Z8[`|L=#Wqz>! efficient because of features of OOP. Here you can access and discuss Multiple choice questions and answers for various competitive exams and interviews. d) Either function overloading or operator overloading because polymorphism can be applied only once in a program, Which of the following is not OOPS concept in Java? Explanation: Private access specifier is the most secure access mode. b) A class inheriting a base class a) Use abstraction at its minimum } Code abstraction as use of object of inbuilt class. Answer: b Codes are more reusability is done using inheritance. Explanation: Abstraction applies to both. b) Protected members c) Data members type cant be changed, or whole code have to be changed }, a) Its school education system c) Create protected member functions to access those data members It is created because the object used in function is a) Polymorphism c) This code is vulnerable function. { b) Abstraction is called a file and device is called a stream d) As many as you want, When OOP concept did first came into picture? an instance is created there is no facility to initialize its members. Answer: a c) Its school education systemIts education system { { public : disps c) Global scope Hence a) Class usage public : int* funs Answer: a { this feature called?
k?
Answer: d
and can code better. return 0; Explanation: Both of them are using polymorphism. }; Answer: d b) class student{ }s1; class topper{ }t1; s1=t1;
same name in same local scope. Answer: b Class in general describes all the properties of base abstract class student, and hence topper class object can be created easily. Compile time polymorphism (overloading) and runtime because the class is accessible locally within the class only. b) Operator overloading only Explanation: Abstraction is hiding the complex code. Explanation: It depends on the access specifier and the type of inheritance used with the class, because if the class is Here the private member is kept private. class hero There is no way to declare the member functions outside the class. a) It is feature of OOP It is __________ to redefine the virtual function in derived class? c) Object-based language return 0;
Explanation: It is to idealize the interface. abstract class student OOP language. c) Provide more number of features a) class student{public: int marks;}s; class stream{int total;}; class topper:public student, public stream{ }; a) Alan Kay b) Data members data type can be changed without changing any other code Answer: d Explanation: Notice that the function name in derived class is different from the function name in base class. do this to pass our own intended values to initialize the object array data. derived class names also in java. It is _________________________ to define the abstract functions. Which syntax for class definition is wrong? c) Both of these are using polymorphism Answer: a b) student class{ }; Q6%uAJzuBa Answer: c how is it actually implemented. /Length1 247184 It doesnt provide more number of features or better features. Explanation: This code maintains encapsulation. pointers. } How to access the overridden method of base class from the derived class? a) By making their visibility mode as public only class student -gQ$_<>lzTrPt7z*9O It cant be called as parent or instance of an object. And if base class is inherited by 2 other classes, it is multiple inheritance. This actually comes under operator overloading. d) Overriding. a) A class inheriting a derived class
Answer: b a) 1970s A directory of Objective Type Questions covering all the Computer Science subjects. Explanation: SmallTalk was the first programming language developed which was purely object oriented. c) It is a way of combining various data members and member functions into a single unit which can operate on any data c) Kotlin Where is abstraction used? Explanation: A temporary object is created to return the value. Explanation: Instance of abstract class cant be created as it will not have any constructor of its own, hence while creating They cant be accessed directly but is possible to be access using member functions. Questions from Previous year GATE question papers, UGC NET Previous year questions and practice sets. into a single unit.
to be upgraded into class in C++ and other languages. And next lower level would contain few of the Explanation: Overloading is determined at compile time. } b) Only class student and topper together can show polymorphism b) Using char* string pointer to be passed to non-member function a) class student{ }; c) Multiple polymorphism d) Very low, Which among the following best describes the Inheritance? data and public access specifiers were present in structures too. a) Java d) Hypothetical, Abstraction gives higher degree of ________ Answer: d Explanation: Using dot operator after the name of object we can access its members. Topper inherits class. d) Small Talk, How many classes can be defined in a single program? calc_grades; Explanation: This code violates the encapsulation. Even ~g c) Cant be used by any other function c) Using access declaration for local variable of main() function use the definition in some other way, so it actually helps to write efficient codes. cout<<name; Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students. Explanation: If using access declaration for private members of base class was allowed in programming, it would have b) Ease in readability of program c) Abstraction can be called both file and stream Answer: b a) More than one method with same name but different method signature and different number or type of parameters responding to the same message in different ways, hence polymorphism. Overloading is type of polymorphism. a) Public members b) Modularity, Pure OOP can be implemented without using class in a program. Answer: c d) Using pointer only, If a local class is defined in a function, which of the following is true for an object of that class? Answer: b Answer: c It { This is done to ensure that The programming need not know how the inbuilt functions are working but }; a) student s[3]={ s(394, 9); s(394, 9); s(394,9); }; d) Ada, If same message is passed to objects of several different classes and all of those can respond in a different way, what is b) Only data Abstract classes doesnt have constructors and hence when a) True Practice test for UGC NET Computer Science Paper.
}; Inheriting an already derived class makes it a) 4 object of a specific class.
inheritance from the 4 basic ones. Explanation: For an object which belongs to a local class, it is mandatory to declare and use the object within the function polymorphism in C language. Explanation: The undefined functions must be defined is a problem, because one may need to implement few undefined. class. b) Overloading d) Kotlin, Which of the following best defines a class? b) Use abstraction to avoid longer codes c) Blueprint of an object Explanation: There are 4 OOPS concepts in Java. d) Not possible, The private members of the base class are visible in derived class but are not accessible directly. those. { c) Camera
we call the disp() function, base class function is executed. b) Friend class can only access protected members of the class, of which it is a friend base class being derived. (True or False) Care has to computer components and so on. { int marks; d) Using the data and functions into derived segment, How many basic types of inheritance are provided as OOP feature? Answer: a functions whereas the class can have both data members and member functions. Whereas motherboard, display and camera are its components. Answer: a Answer: a developed by Alan Kay. Answer: a abstraction. The questions asked in this NET practice paper are from various previous year papers. c) Idealized interface d) Its education systemIts school education system. b) Logical a) Using private access specifier for data members Ask study questions in English and get your answer as fast as 30min for free. a) Binding and Hiding respectively It is the implementation of Answer: c When we create a derived class object, the system tries to invoke
b) Private scope Downloaded from: https://cse-r17.blogspot.com, CS8392- Object Oriented Programming- By Learn Engineering, GOJ-225s djd d d d0xcccccccccxx d jdjjj ssssfn j jjj n km kkkn k kkkffdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd ddddddddddddddddddddddfffffff, MCQ-PSA Unit 3 - unit wise psa mcq questions and answers, A class is Blueprint of an object which describes/ shows all the functions and data that are provided by an, Member functions are allowed inside a class but were not present in structure concept. b) Hiding and Binding respectively a) C++ b) Abstraction b) This code doesnt maintain encapsulation inheritance can be implemented using interfaces in Java. } c) Parent class Which was the first purely object oriented programming language developed? Which among the following Explanation: Its false because for a program to be pure OO, everything must be written inside classes. d) Class is similar to union and structures, Instance of which type of class cant be created? Class constructors cant be assigned any explicit value as in option class represents the whole system. It this way the Explanation: Using inheritance we can reuse the code already written and also can avoid creation of many new functions This feature have helped us modify the structures used in C language b) student s[2]={ s(394,9), s(222,5) }; c) class student{ public: student(int a){ } }; The best way to understand this is to consider a whole Explanation: It is a way of combining both data members and member functions, which operate on those data members, d) Provide better features. an instance of class, it cant initialize the object members. b) Object can be declared inside any other function stream d) Hypothetical, Object is ________ abstraction. b) False, Using encapsulation data security is ___________ c) Encapsulation a) Inheritance Explanation: Member functions must be declared inside class body, though the definition can be given outside the class
destroyed whole concept of encapsulation. a) Class based language Which among the following is wrong? c) Purely ensured Hence use of public It cant increase the program complexity, as the feature itself is made to hide it.
Private inheritance can only inherit protected and public members. b) False, How can you make the private members inheritable? Explanation: Only insertion operator can be overloaded among all the given options. 34 0 obj violated, the program cant be labelled as purely OO. Explanation: Abstraction is called stream to provide a level of complexity hiding, for how the files operations are actually d) It is not possible, If a derived class object is created, which constructor is called first? Only major difference is that a structure doesnt have member. a) Code modification can be additional overhead Data members, static, Institute of Technology & Management Universe, Vadodara, Biochemistry and Biomolecules (Biochem221), Dimensions and Methodology of Business studies, No fixation of wages in certain cases (Ss 2A), Ten difference between administrative law and constitutional law, Krandall 1 - Mechanics of Solid H.Crandall Solution chapter 1, Krandall 8 - Mechanics of Solid H.Crandall Solution chapter 8, Unit-i (Definition, Nature and Scope of Jurisprudence, Kinds of Law, Sources of Law).
b) Can be used by main() function of any other program class failed{ int marks; }; a) Only class student can show polymorphism /Supplement 0 Exactly same declaration in base and derived class includes______________. member functions illustrates abstraction here. Answer: d
b) Its education system indicates many-forms. Member functions can never change the data type of same Answer: d
d) It can be done both by making the visibility mode public or protected, Which among the following best describes polymorphism? memory address/stores that address. b) Display d) This code gives error. gives pure security. d) Phone, Which among the following is not a level of abstraction? a) True it is a problem sometimes. Explanation: The feature defined in question defines polymorphism features. Explanation: It is not mandatory that you have to make the visibility mode either public or protected. d) Friend class cant access any data member of another class but can use its methods, What is the scope of a class nested inside another class? { Answer: d a) It gets inherited publicly by default b) Nested class data can continue in the same way without any modification. Which class/set of classes can illustrate polymorphism in the following code? b) Andrea Ferro Which among the following is correct for multiple inheritance? alteration. d) It is the ability for undefined message/data to be processed in at least one way. And the polymorphism can be Explanation: It never increases function definition overhead, one way or another if you dont use polymorphism, you will Explanation: Member functions are allowed inside a class but were not present in structure concept. Explanation: It is actually the ability for a message / data to be processed in more than one form. The temporary variable returns the value and then gets destroyed. c) abstract class student{ }s[50000000]; a) It is the ability for a message/data to be processed in more than one form Answer: b Explanation: Class topper is getting derived from 2 other classes and hence it is multiple inheritance. Hence the class is logical abstraction and its object is real. Explanation: If the access mode is not specified during inheritance, the class is inherited privately by default. structures and then declare pointers which in turn points to some function. s; of the features of an object. Explanation: It is possible to implement polymorphism in C language, even though it doesnt support class. b) It gets inherited protected by default It is not necessary that polymorphism can be used only once in a d) More than one method with same name, same number of parameters and type but different signature. c) View level What should be used to call the base class method from the derived class if function overriding is used in Java? (in C++) Polymorphism is possible in C language. Functions declared and defined in base class, Function which may or may not be defined in base class, Function which must be declared in derived class, The abstract functions must be only declared in derived classes, The abstract functions must not be defined in derived classes, The abstract functions must be defined in base and derived class, The abstract functions must be defined either in base or derived class. We can add one more type as Hybrid inheritance but that is actually the combination any types of c) Only control d) Object are returned implicitly, we cant say how it happens inside program. c) Can be used any way } Unit 3 Institutions Supporting Entrepreneurs, Structure and Composition of Indian Society, Class 12 Chapter 4 Business Studies Revision Notes, Notes of Ch 3 Election and Representation class 11, Questions Answers from The Tempest Act 4 Scene 1. Caste in India Their Mechanism, Genesis, and Development by B - Google Docs, Stopping by Woods on a Snowy Evening by Robert Frost - Google Docs, S - enjoy Summer internship project of HDFC, Constitutional Law - dddddddddnnvvvvvvvvvvvvvvvvvvvvvvvvvj, Gas Turbine Combustion - Alternative Fuels and Emissions, Industrielle Geschftsprozesse: Nordrhein-Westfalen, Frysk Wurdboek: Hnwurdboek Fan'E Fryske Taal ; Mei Dryn Opnommen List Fan Fryske Plaknammen List Fan Fryske Gemeentenammen. { Data abstraction involves handling pieces of data in meaningful ways. public : void disps Which feature of OOP is exhibited by the function overriding. b) It doesnt support all types of inheritance
Code Modularity is supported by using different code files and classes. b) Ensured to some extent Answer: d a) Can be used by any other function b) Java Consider the following code and select the correct option. Kpc6;:u!2 Answer: c Explanation: Keyword class should come first. languages and got implemented successfully, SmallTalk was first language to use pure OOP and followed all rules strictly. Answer: a c) Using public member functions to access and manipulate the data members Inheritance, Encapsulation, Polymorphism and Abstraction. It gives an overview Abstract must not be defined in base class whereas virtual function can be defined, Either of those must be defined in base class. b) Class and structure { a) Logical level There is no term defined as pass as function for objects. c) Duplicate/Redundant data Explanation: You need to focus on how the output is going to be shown, no space will be given after first message from public : calc_grades b) Instance of an object Outside code cant access the b) 3 Note that its not an OOP language. >> a) True Explanation: We can never create instance of an abstract class. d) 1, Which among the following best defines single level inheritance? b) Physical level Answer: c Answer: c You can do either of those data members. { cout<<Its school education system; d) Can be accessed using scope resolution operator, When an object is returned___________ Data members, static Explanation: Object cant be passed as function as it is an instance of some class, its not a function. unit, If data members are private, what can we do to access them from the class object? b) False, Which among the following is false, for a member function of a class? Using already defined functions is not inheritance as we are not adding any of our own features. definition depends on programmer so it can be left empty also. Study of RJ45 and CAT cabling and connection using crimping tool. may be used inside the class. Explanation: The encapsulation can only ensure data security to some extent. It doesnt allow members to be inherited. It uses data members and their functioning as data It is not necessary to use the c) Use abstraction whenever possible to avoid duplication b) class student{int marks;}; class stream{ }; class topper: public student{ }; d) Efficient Code. int marks; Answer: b a) It supports usual declaration of primitive data types Not mandatory for all the derived classes, The abstract function definitions in derived classes is enforced at _________. d) Unstable interface, Abstraction can apply to ____________ a) True functioning of phone, display shows the display only, and the phone is represented as a whole. There are chances to modify its whole data easily. class average:public student Explanation: A class inheriting a base class defines single level inheritance. d) External level. with no data members. }; invoked before the derived class constructor. Answer: a As if it was possible, any class which gets inherited privately, would have been void mains d) 1995, Why Java is Partially OOP language? Explanation: As the programming language rules apply, all the public and protected members of base class becomes c) It allows code to be written outside classes b) The same object used in function is used to return the value an object. d) Classes, Which among the following can be viewed as combination of abstraction of data and code. b) Logical d) Overloading && Find the output of the following program. Answer: c c) Using already defined functions in programming language Explanation: OOP first came into picture in 1970s by Alan and his team. a) Object Answer: b d) Using access declaration for global variables. Explanation: Class definition must end with a semicolon, not colon. Option d is correct because topper class is inheriting the cgpa=j hierarchical inheritance. What is this feature of enforcing definitions of abstract function at compile time called? a) Object is accessible outside the function polymorphism (overriding). b) Overloading += d) If classes are supported, polymorphism will always be supported, Which among the following is the language which supports classes but not polymorphism? b) Class definition must be ended with a colon Compiler doesnt have to know the structure of the class to use a pointer because the pointers only points to a It cant be used outside main() a) Protected scope a) Code reusability Class can have only member functions in its body d) Inheritance, Which language does not support all 4 types of inheritance? multilevel inheritance. Now we can overload these functions, hence implementing a) Only 1 Answer: d c) class student{int marks;}; class stream:public student{ }; d) Class failed should also inherit class student for this code to work for polymorphism.
provided to use when you need to reuse the data of a class but dont want that class to have those special functions. together. Explanation: Object can be viewed as abstraction of data and code. d) Public access specifier, Which is not feature of OOP in general definitions? d) At execution time, When Overloading does not occur? Hence the private members are accessible but not directly. Explanation: First the base class constructor is invoked. Encapsulation is data binding, as in, we try to combine a similar type of data and functions We brought real Experts onto our platform to help you even better!