Computer Applications

Here is a skeleton definition of a class :

class Sample
{
    int i;
    char c;
    float f;
    :
    //public members
    :
}

Implement the constructor.

Java Constructors

8 Likes

Answer

The constructor of the class is given below:

public Sample(int a, char b, float c)
{
    i = a;
    c = b;
    f = c;
}

Answered By

5 Likes


Related Questions