Technical Discussion :: C++
Home > Freshers > Technical Interview Questions > C++
84. Can we implement all the concepts of OOPS using the keyword struct?
Answer:
Yes, struct is similar to class, only all attributes/methods are public by default in the struct. You can very well have methods and attributes in a struct. You can also inherit from a struct (default inheritance is public).
Asked In :: TCS Virtusa Syntel Inc. Societe Generale
Yes, struct is similar to class, only all attributes/methods are public by default in the struct. You can very well have methods and attributes in a struct. You can also inherit from a struct (default inheritance is public).