Answer Posted / julian c
Stop thinking like programmers saying "Object is a class in Java, c# etc".
I have in front of me a number of Whiffleplops of different colours; black, blue and red.
The black, blue and red Whiffleplops are three different objects. They are also of different sizes and I can play with them.
Do you have a Whiffleplop with you? No? (Why not).
Do you see that Whiffleplop is a CLASS of object that I can define as having two attributes (colour and size) and behaviour (you can play with it)? When you do get a Whiffleplop of any size or colour then you'll have an object, or an instance of the Whiffleplop class. You don;t have to have one for me to define the class though!
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is hybrid inheritance?
What is abstract method?
What are the limitations of inheritance?
What is the @functionalinterface annotation?
What is composition? Explain the purpose of composition.
Can you explain primordial class loader?
Explain the use of Vtable and what are the various problems to override the functions?
Are constructors inherited? Can a subclass call the parent's class constructor? When?
Why dynamic loading is used in object-oriented programming?
Differences between functional programming and object-oriented programming?
What is the difference between aggregation and composition?
What is a static method? Why do we need static methods in java 8 interfaces?
Can we override a method by using same method name and arguments but different return types?
Is it possible to provide method implementations in java interfaces? If possible, how do we provide them?
How do we implement serialization actually?