Introduction to OOP Chapter 18: Generics : next previous audio real text

Can Be Filled with Different Arguments


	iBox.setValue(3.1415); // ERROR - invalid type

	Box <double> dBox(2.7);
	cout << dBox.getValue();
2.7
	dBox.setValue(3.1415);
	cout << dBox.getValue();
3.1415
	iBox = dBox; // ERROR - mismatched types
In the next chapter we will see how generics are used to create collection classes.
Intro OOP, Chapter 18, Slide 05