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
write string class as your own class in java without using any built-in function
Can we have inheritance without polymorphism?
any one please tell me the purpose of operator overloading
What is an interface in oop?
i=20;k=0;
for(j=1;k-i;k+=j<10?4:3)
{
cout< What are the components of marker interface? Can we define a class within the interface? What is the benefit of oop? What is stream in oop? What are the data types in oop? What are functions in oop? What is abstraction oop? Why do we use polymorphism? Can you inherit a private class? What is polymorphism in oops with example?