Computer Applications
Here is a skeleton definition of a class :
class Sample
{
int i;
char c;
float f;
:
//public members
:
}
Implement the constructor.
Related Questions
Write a class specifier (along with its constructor) that creates a class student having two private data members : rollno and grade and two public functions init( ) and display( ).
(Do not write full definitions of member functions except for constructor).Can you think of the benefits of a private class if any ? What are they ?
Define a constructor function for a Date class that initializes the Date objects with given initial values. In case initial values are not provided, it should initialize the object with default values.
What condition(s) a function must specify in order to create objects of a class ?