### [JAVA注释模板](https://www.isearch.life/article/396) **Published:** 2026-03-02T08:53:18 **Author:** tearell **Excerpt:** 普通类注释 /** * description * @author tearell * @date 2019-08-08 */ public class Demo{ } 枚举类注释 /** * 数据库类型 * @author tearell ## 普通类注释 ```java /** * description * @author tearell * @date 2019-08-08 */ public class Demo{ } ``` ## 枚举类注释 ```java /** * 数据库类型 * @author tearell * @date 2019-08-08 */ public enum DbType { /** Oracle,甲骨文数据库 */ Oracle, /** Microsoft Sql Server Database,微软Sql Server数据库 */ MsSql, /** MySql( my(the name of Monty's daughter ) sql),甲骨文收购的一个开源数据库 */ MySql } ``` ## 方法注释 ```java /** * [把大象放到冰箱 ] * @param elephant [大象] * @param fridge [冰箱] * @throws Exception [举例说明而已,具体代码中要用具体的异常类,如IOException之类的] */ public void put(Elephant elephant,Fridge fridge) throws Exception{ try{ boolean flag = true; //判断xxxx逻辑 if(flag){//flag为true openFridgeDoor(); putElephantIntoFridge(); closeFridgeDoor(); } } catch(FridgeIsFullException exFull) { System.out.pintln("冰箱太满了"); } catch (ElephantIsTooFatException exFat) { System.out.pintln("大象太肥了"); } } public static void main(String[] args) { Elephant elephant=new Elephant("比较瘦的大象,可以放冰箱"); Fridge fridge= new Fridge("比较大而且空的冰箱,可以冰大象"); put(elephant,fridge); } ``` ## TODO/FIXME ```java /** * xxxxxxxx * @Author tearell * @date 2019-08-08 */ public class User{ /** * TODO:(tearell,2019-08-08,2019-08-10) * 需要完成的内容: * 检查当前登录人是否有权限 * 判断需要修改密码的用户的状态 * 验证密码复杂度 * * [重设密码,由用户自行输入密码] * @param userId [用户Id] * @param newPassword [用户输入的新密码] */ public void resetPassword(int userId,String newPassword){ } /** * FIXME:(tearell,2019-08-08,2019-08-10) * 错误描述: * 之前的删除用户操作是把用户直接从数据库删除了 * 恢复用户是直接根据userId取用户,并进行操作 * 因为被删除的用户getUser操作的是null,所以报异常了。 * 修改方式: * 判断是否为null再进行修改。 * 关联修改: * 将真删,变成标记。 * 如果用户数量庞大,则分表操作,将被删用户转移到已删除的表中 * 并将getUser方法区别对待。 * [恢复用户] * @param userId [用户Id] */ public void recoverUser(int userId){ } } ``` ## 详细注释内容/DOC ```java /** *
* description: * xxxxxx *
* author: * xx *