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 static modifier?
How to use CMutex, CSemaphore in VC++ MFC
Can a varargs method be overloaded?
i got a backdoor offer in process global,Bangalore..Can i work with it?
Why is object oriented programming so hard?
What is abstract class in oop?
What is polymorphism in oop example?
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 with example?
What is polymorphism what is it for and how is it used?
Can an interface inherit a class?
write a programe to calculate the simple intrest and compund intrest using by function overlading
what type of question are asked in thoughtworks pair programming round ?
Question: Write a program that prints a paycheck. Ask the program user for the name of the employee, the hourly rate, and the number of hours worked. If the number of hours exceeds 40, the employee is paid “time and a half”, that is, 150 percent of the hourly rate on the hours exceeding 40. Be sure to use stepwi se refine ment and break your solution into several functions. Use the int_name function to print the dollar amount of the check.
Why is static class not inherited?