What is the difference between class and object?
Answer Posted / johncz
Class is a template for the custom type that can be used as
variable. It defines types of data that class contains and
the set of functions to manipulate those data types. It is
just a recipe to be used when class is instantiated.
Object is an entity created using class template. Such an
object occupies computer’s memory. Each object of the class
is independent entity.
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What type of loop is a for loop?
Why is it so that we can have virtual constructors but we cannot have virtual destructors?
What is polymorphism and its types?
how to get the oracle certification? send me the answer
Why do we use oop?
What is Difference Between Inheritance and creating object and getting data? means Class A extends B{ B.getMethod();} (OR) Class A{ b obj=new B(); obj.getMethod(); }
What is encapsulation selenium?
What causes polymorphism?
What does and I oop mean?
What is protected in oop?
Why do we use class?
What is encapsulation and abstraction? How are they implemented in C++?
Who invented oop?
What is object in oop with example?
Question: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date.