What are virtual functions?

1 Answer

Answer :

A virtual function allows derived classes to replace the implementation provided by the  base class. The compiler makes sure the replacement is always called whenever the object  in question is actually of the derived class, even if the object is accessed by a base pointer  rather than a derived pointer. This allows algorithms in the base class to be replaced in  the derived class, even if users don't know about the derived class.

Related questions

Description : What do you mean by pure virtual functions?

Last Answer : A pure virtual member function is a member function that the base class forces derived classes to provide. Normally these member functions have no implementation. Pure virtual functions are equated to zero. class Shape { public: virtual void draw() = 0; };

Description : Which type of organization outsources major business functions? (a) Modular ; (b) Innovation ; (c) Virtual ; (d) Feminine

Last Answer : (a) Modular ;

Description : What is pure virtual functions? Write down the rules used for pure virtual function.

Last Answer : A pure virtual function is a function which is declared in a base class and which does not have definition relative to the base class. In such cases, the compiler requires each derived class to either ... A class containing pure virtual functions cannot be used to declare any objects of its own.  

Description : Which of the following correctly describes overloading of functions? (A) Virtual polymorphism (B) Transient polymorphism (C) Ad-hoc polymorphism (D) Pseudo polymorphism

Last Answer : (C) Ad-hoc polymorphism

Description : In C++, polymorphism requires: (A) Inheritance only (B) Virtual functions only (C) References only (D) Inheritance, Virtual functions and references

Last Answer : (D) Inheritance, Virtual functions and references 

Description : What is Virtual Memory ?

Last Answer : The computer has physical memory or RAM attached. RAM has size limitations. When you turn on the computer, the program loads in RAM. When you open a file, it also loads in RAM. If the file ... address is called mapping. Copying a virtual page from disk to main memory is called paging or shopping.

Description : Virtual memory is 1) Memory on the hard disk that the CPU uses as an extended RAM 2) RAM 3) Only necessary if you do not have any RAM in your computer 4) A back up device for floppy disks 5) None of these

Last Answer : Answer :2

Description : Which of the following is used to hold running program instructions? a) Primary Storage b) Virtual Storage c) Internal Storage d) Minor Devices

Last Answer : Answer: a Explanation: The primary storage is responsible for holding the data, intermediate results and the results of ongoing processes or jobs. Virtual storage is the main memory storage required for saving large amount of data for future reference. The other options are invalid

Description : The two basic types of memory in a computer are ________ a) Primary and major b) Primary and Secondary c) Minor and Major d) Main and virtual

Last Answer : Answer: b Explanation: There are two types of memories in a computer system: The Primary Memory and the Secondary Memory. The primary memory can be directly accessed by the CPU whereas the secondary memory cannot be directly accessed

Description : VDU stands for __________ a) Virtual Display Unit b) Visual Display Unit c) Virtual Detection Unit d) Visual Detection Unit

Last Answer : Answer: b Explanation: A Visual Display unit is also referred to as the monitor who basically is used to give the results or outputs to the user. It comprises of a cathode ray tube internally

Description : Technique of using disk space to make programs believe that the system contains more Random Access Memory(RAM) than is actually available is called ______ A. Random Access Memory B. Primary Memory C. Secondary Memory D. Virtual Memory

Last Answer : D. Virtual Memory

Description : Technique to implement virtual memory where memory is divided into units of fixed size memory is _________ A. Paging B. De-fragments C. Segmentation D. None of the above

Last Answer : A. Paging

Description : Under virtual storage ________ A. Two or more programs are stored in primary storage B. Only active pages of a program in primary storage C. Inter-program, interference may occur D. None of the Above

Last Answer : B. Only active pages of a program in primary storage

Description : ___________ is a very high speed memory placed in between RAM and CPU. A. Magnetic disk B. Magnetic drum C. Virtual memory D. Cache memory

Last Answer : D. Cache memory

Description : Virtual memory is _________ A. an extremely large main memory B. an extremely large secondary memory C. a type of used in super computers D. an illusion of extremely large main memory

Last Answer : D. an illusion of extremely large main memory

Description : _____________is a feature of an operating system that allows a computer to compensate for shortages of physical memory by temporarily transferring pages of data from RAM to disk storage. A. Flash memory B. Virtual memory C. Buffer D. None of the Above

Last Answer : B. Virtual memory

Description : _________ is a type of non-volatile memory that erases data in units called blocks. A. Flash memory B. Virtual memory C. Buffer D. None of the Above

Last Answer : A. Flash memory

Description : _________ is the transfer of computer data from a temporary storage area to the computer’s permanent memory. A. Flash B. Virtual C. Buffer Flush D. None of the Above

Last Answer : C. Buffer Flush

Description : _________ is a data area shared by hardware devices or program processes that operate at different speeds or with different sets of priorities. A. Flash memory B. Virtual memory C. Buffer D. None of the Above

Last Answer : C. Buffer

Description : Which is an interactive device that facilitates touch sensation and fine-motion control in Robotics and Virtual reality? A. Light Pen B. Joystick C. Data Glove D. None of the Above

Last Answer : C. Data Glove

Description : In which of the following types of banking, there is a direct execution of transaction between a bank and its consumers? A. Retail Banking B. Universal Banking C. Virtual Banking D. Unit Banking E. other than those given as options

Last Answer : A. Retail Banking Explanation: Retail banking also known as Consumer Banking is the provision of services by a bank to individual consumers, rather than to companies, corporations or other ... include savings and transactional accounts, mortgages, personal loans, debit cards, and credit cards.

Description : Unified Payment System (UPI), a common platform which links your _________ to a virtual payment address, effectively making money transfer as easy as an SMS. A. Bank Account Number B. IFSC Code C. Virtual Address D. All of the Above E. None of the Above.

Last Answer : A. Bank Account Number Explanation: Unified Payment System (UPI), a common platform which links your bank account number to a virtual payment address, effectively making money transfer as easy as an SMS.

Description : Which of the following is the format of Virtual Address in UPI? A. [name] @ [bank name] B. [Phone number] @ [bank name] C. [name] @ [bank branch name] D. Both (A) and (B) E. Both (B) and (C)

Last Answer : D. Both (A) and (B) Explanation: Instead of account details, the receiver can share a virtual address, which can be your name, or your phone number and the sender can ... your phone number is 1234567890, then your virtual address could be 1234567890@axisbank or 1234567890@icicibank and so on.

Description : Customers using the UPI system only share _____ A. Bank Account Number B. IFSC Code C. Virtual Address D. All of the Above E. None of the Above.

Last Answer : C. Virtual Address Explanation: Customers using the system do not have to disclose any sensitive information such as bank account numbers or IFSC codes during a financial transaction. It is safe as the customers only share a virtual address and provide no other sensitive information.

Description : Power Point 97 incorporated the _______language , underlying all macro generation in office 97: a) Visual Basic for Applications b) Visual Basic for Software c) Virtual Base Language d) None of These

Last Answer : a) Visual Basic for Applications

Description : VBA stands for: a) Visual Basic For Application b) Virtual Based For Application c) Various Basics Application d) None of These

Last Answer : a) Visual Basic For Application

Description : VPN stands for: a) Virtual Perfect Network b) Virtual Power Network c) Virtual Private Network d) None of These

Last Answer : c) Virtual Private Network

Description : VGA stands for: a) Virtual Graphics Assessment b) Video Graphics Array c) Various Graphics Arrays d) None of These

Last Answer : b) Video Graphics Array

Description : VGA stands for: a) Virtual Graphics Adapter b) Video Graphics Adapter c) Various Graphics Adapter d) None of These

Last Answer : b) Video Graphics Adapter

Description : VDU stands for: a) Virtual Display Unit b) Video Display Unit c) Visual Display Unit d) None of These

Last Answer : c) Visual Display Unit

Description : JVM stands for: a) Java Via Mechanism b) Justify Virtual Method c) Jumbo Verbose Mechanism d) Java Virtual Machine e) None of These

Last Answer : d) Java Virtual Machine

Description : Virtual Memory is: a) An extremely large main memory b) An extremely large secondary memory. c) An illusion of an extremely large memory. d) None of The Above

Last Answer : c) An illusion of an extremely large memory.

Description : VIRUS stands for 1) Very Important Resource Under Search 2) Virtual Information Resource Under Resize 3) Verify Interchange Result Until Source 4) Very Important Record User Searched

Last Answer : 2) Virtual Information Resource Under Resize

Description : What is meant by a Virtual Classroom?

Last Answer : In a virtual classroom, the teacher deliver lecture at its own workplace while the students, connected to a network, may listen to him at their homes. They may put questions and answers are sent to them via email.

Description : VIRUS stands for 1 Very Important Resource Under Search 2 Virtual Information Resource Under Resize 3 Verify Interchange Result Until Source 4 Very Important Record User Searched

Last Answer : 2 Virtual Information Resource Under Resize

Description : What is virtual class and friend class?

Last Answer : Friend classes are used when two or more classes are designed to work together and need access to each other's implementation in ways that the rest of the world shouldn't be allowed to have ... for class DatabaseCursor to have more privilege to the internals of class Database than main() has.

Description : Virtual constructor: Constructors cannot be virtual. Declaring a constructor as a virtual function is a syntax error. Does c++ support multilevel and multiple inheritance?

Last Answer : Yes.

Description : What is virtual constructors/destructors?

Last Answer : Answer1 Virtual destructors: If an object (with a non-virtual destructor) is destroyed explicitly by applying the delete operator to a base-class pointer to the object, the base-class destructor ... base-class pointer to a derived-class object, the destructor for the appropriate class is called.

Description : The name of the protocol which provides virtual terminal in TCP/IP model is. A) Telnet B) SMTP C) HTTP

Last Answer : A) Telnet

Description : 3 Long Form of the VPN A)Virtual Private Network B)Virtual Personal Network C)Both D)None

Last Answer : A)Virtual Private Network

Description : The characteristic of the computer system cable of thinking, reasoning and learning is know as (a) Machine intelligence (b) Human intelligence (c) Artificial intelligence (d) Virtual intelligence

Last Answer : (c) Artificial intelligence

Description : Long Form of the VPN A)Virtual Private Network B)Virtual Personal Network C)Both D)None

Last Answer : A)Virtual Private Network

Description : _______ is a type of computing that performs computation, storage and even applications as a service across a network. (1) Cloud Computing (2) Distributed Computing (3) Parallel Computing (4) Virtual Computing

Last Answer : Cloud Computing 

Description : In IT, associative memory is called as (1) Virtual memory (2) Cache memory (3) Content addressable memory (4) Main memory

Last Answer : Content addressable memory

Description : Cancellation of thread occurs only when it reaches a : (1) Cancellation point(2) Error point (3) Virtual point (4) Target point

Last Answer : Cancellation point