Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
package myannotation;
public class MyAnnotationTest {
public String hoge; //←valueの値の指定をしていないのでデフォルト値
@MyAnnotation(value = "コンストラクタ!!!") //←値を指定
public MyAnnotationTest(String hoge) {
this.hoge = hoge;
@MyAnnotation("メソッド!!") //←キー名がvalueの単一値アノテーションはキー名を省略可能
public String getHoge() {
return hoge;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.