ure out the amount of interest per month")
//或者@TODO(value="Figure out the amount of interest per month")
public void calculateInterest(float amount,float rate)
{
}
iv.设置默认值
package com.oreilly.tiger.ch06;
public @interface GroupTODO {
public enum Serverity { CRITICAL,IMPORTANT,IRIVIAL,DOCMENTATION };
Severity severity()
default Severity.IMPORTANT;
String item ();
String assignedTo();
String dateAssigned();
}
}
v.使用默认值
@com.oreilly.tiger.ch06.InProgress
@GroupTODO(
item="Figure out the amount of interest per month",
assignedTo = "Brett McLaughlin",
dateAssigned = "08/04/2004"
)
public void calculateInterest(float amount, float rate)
{
//Need to finish this method later
}
vi.改写默认值
@com.oreilly.tiger.ch06.InProgress
@GroupTODO
{
severity = GroupTODO.Severity.DOCUMENTATION,
item = "Need to explain how this rather unusal method works",
assignedTo = "Jon Stevens",
dateAssigned = "07/30/2004"
}
这样就对Java元数据/Java注释进行了总结。 |