Conversion from a basic type to a class type may be
achieved using______________
Answer Posted / mohit swami
"constructor"
for example:
class time
{
int hrs;
public:
time(int t) //constructor
{
hrs=t/60;
}
};
void main()
{
time T1; // object T1 is created
int duration=85;
T1=duration; //int to class type
}
| Is This Answer Correct ? | 9 Yes | 3 No |
Post New Answer View All Answers
What is this pointer in oop?
What does and I oop mean in text?
What is polymorphism what is it for and how is it used?
How long to learn object oriented programming?
What is object and example?
What are benefits of oop?
What do you mean by Encapsulation?
What is the example of polymorphism?
What language is oop?
Can static class have constructor?
what are the ways in which a constructors can be called?
What is encapsulation in oops?
What is abstraction and encapsulation?
What is abstraction with example?
Can you inherit a private class?