> For the complete documentation index, see [llms.txt](https://dreamylost.gitbook.io/question4scala/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dreamylost.gitbook.io/question4scala/scala2/3.-tan-tan-classtagt-he-manifestt-fan-she-he-hong.md).

# 谈谈ClassTag\[T]和Manifest\[T]?（反射和宏）

⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️

1. Manifest是旧的，已废弃。包含类型T的不透明描述符。
2. ClassTag是新的，包含T类型的运行时类信息，但不如TypeTag中的详细，TypeTag包含所有静态类型信息。
3. 可以使用runtimeClass获取运行时类
4. 当创建泛型（编译期类型是未知的）数组时，必须使用这两者之一（的隐式参数）。

答到1.2.3及格

3.4其实是一个，但允许未使用过的不知道这条。答完满分
