edited by
901 views
0 votes
0 votes

Which of the following is not correct for virtual function in C++?

  1. Must be declared in public section of class
  2. Virtual function can be static
  3. Virtual function should be accessed using pointers
  4. Virtual function is defined in base class
edited by

1 Answer

3 votes
3 votes

A virtual cant be static 

so option B

virtual function cannot be global or static because, by definition, a virtual function is a member function of a base class and relies on a specific object to determine which implementation of the function is called. You can declare a virtual function to be a friend of another class.

Answer:

Related questions

1 votes
1 votes
2 answers
1
Arjun asked Nov 5, 2017
3,072 views
Which speed up could be achieved according to Amdahl's Law for infinte number of processes if $5\%$ of a program is sequential and the remaining part is ideally parallel?...
0 votes
0 votes
1 answer
2
Arjun asked Nov 5, 2017
2,522 views
Which of the given wireless technologies used in IoT, consumes the least amount of power?ZigbeeBluetoothWi-FiGSM/CDMA
0 votes
0 votes
2 answers
3
Arjun asked Nov 5, 2017
4,593 views
Which of the following is not a Clustering method?K-Means methodSelf Organizing feature map methodK- nearest neighbor methodAgglomerative method