Static Members in Classes – MCQs

30 Score: 0 Attempted: 0/30 Subscribe
1. : What is a static data member in a class?





2. : Which keyword is used to declare a static member in a class?





3. : How many copies of a static data member exist per class?





4. : Where is the memory for static data members allocated?





5. : Can static data members be private?





6. : How are static data members accessed?





7. : What is a static member function?





8. : Can static member functions access non-static members?





9. : What is required to define a static data member outside the class?





10. : Which of the following is true about static member functions?





11. : Can a static function be overloaded?





12. : Can static data members be initialized inside the class?





13. : Can static member functions be virtual?





14. : How can you access a static member function?





15. : Can a static data member be accessed before creating any object?





16. : Can a class have both static and non-static members?





17. : What is the use of a static counter in a class?





18. : What is the default value of a static int variable?





19. : Can static functions be declared as friend?





20. : What happens if a static member is not defined outside the class?





21. : When is a static variable in a class initialized?





22. : Can a static member be constant?





23. : What type of members can static member functions access?





24. : What is the storage class of a static member?





25. : Which operator is used to define static members outside the class?




26. : Can static members be inherited?





27. : How is static data member shared among objects?





28. : Which of the following can modify static members?





29. : Why are static members useful in classes?





30. : Where should you define a static data member after declaring it inside the class?





Leave a Comment

All copyrights Reserved by MCQsAnswers.com - Powered By T4Tutorials