---
title: "转载的"
author: "fgh2011"
date: "2012-05-02T17:51:05Z"
tags: []
categories: ["编程语言"]
slug: "untitled"
draft: false
lastmod: "2012-05-02T17:51:05Z"
id: 1507866
url: "https://fgh2011.iteye.com/blog/1507866"
---

1、@Override @SuppressWarnings @Deprecated 这三个注解的生命周期   
分别是什么(对应的@Retention(RetentionPolicy))的取值   
分析：@Override @SuppressWarnings 都是给编译器用的，编译器检查完成之后就没有用了，所以他们的生命周期在   
resource阶段，而@Deprecated虽然也是给编译器用的但是不一样，例如：System.runFinalizersOnExit(true)的这句   
代码我们并没有用@Deprecated注解但是Eclipse仍会给他打上横线表示它过时了那是因为他在字节码中看到的，所以他是在runtime阶段的