Skip to main content

Posts

Showing posts from 2014

OOPS Interview Questions

1. What is mean by Class? Class is a structure that describes the state (property) and behavior (methods) of the object. It is a template or blueprint to create objects of the class. Class represents the noun and it can be used as type in programming language. E.g Car, Person etc 2. What is mean by Objects? Object is an executable copy of a class. State and behavior of the objects are defined by class definition. We can create multiple objects for single class. It is also called as instance of the class. When an object is created from the class, memory will be allocated in RAM. e.g Car- Maruthi, Alto, Zen etc. Person- Ram, Sam, John etc 3. What is mean by Struture? Structure is a light-weight class used to create user-defined types containing only public fields. Structure can't have implementation inheritance, but it can have interface inheritance. We cannot modify the default constructors as like a class. Structure is a value type holds their value in memory when they are