InterviewSolution
| 1. |
Help me guys,those answer u know plz answer me except question no. 1 |
|
Answer» 3. An object is something with a state and a behaviour. EG: Bicycle(State=Current Gear, Current Pedal Cadence, Current Speed and Behaviour = Changing Gear, Changing Pedal Cadence, Changing Speed.Following this logic, real-world objects include bikes, animals, cars, speakers, and lights. There are more.4. Software objects are conceptually similar to real-world objects: they too consist of a state and related behaviour. An object stores its state in fields (variables in some programming languages) and exposes its behavior through methods (functions in some programming languages). Methods operate on an object's internal state and serve as the primary mechanism for object-to-object communication. Hiding internal state and requiring all interaction to be PERFORMED through an object's methods is known as data encapsulation — a fundamental principle of object-oriented programming.5. Classes are BLUEPRINTS for creating objects. If we categorize the items - for EXAMPLE man and woman comes under people, cat and dog comes under animals. In programming, we create blue print (class) using which we create objects. So objects are created from the class and each objects may holds different features and can do similar or different THINGS which all depends from which class object is created and with what features.A simple example of this is that a printer is a class, and the paper (the thing it prints/creates) is an object, created using the class (the printer).6. This is because of the above explanation - factories create things, and classes create objects.7. This basically creates an instance of the class employee (using the default constructer) with the name staff.Explanation:Hope this helps! |
|