
Java 注释是编译器和解释器不执行的语句。注释可用于提供有关变量、方法、类或任何语句的信息。它还可以用于隐藏特定时间的程序代码。
Java 中的注释分为三种类型。
单行注释以 // 开始,到行尾结束。
如果您是新用户,请直接将本程序的所有文件上传在任一文件夹下,Rewrite 目录下放置了伪静态规则和筛选器,可将规则添加进IIS,即可正常使用,不用进行任何设置;(可修改图片等)默认的管理员用户名、密码和验证码都是:yeesen系统默认关闭,请上传后登陆后台点击“核心管理”里操作如下:进入“配置管理”中的&ld
0
public class SingleLineComment {
public static void main(String[] args) {
// To print output in the console
System.out.println("Welcome to Tutorials Point");
}
}Welcome to Tutorials Point
多行注释以 /* 开头,以 */ 结尾,跨多行。
立即学习“Java免费学习笔记(深入)”;
public class MultiLineComment {
public static void main(String[] args) {
/* To print the output as Welcome to Tutorials Point
in the console.
*/
System.out.println("Welcome to Tutorials Point");
}
}Welcome to Tutorials Point
文档样式注释以 /** 开头,以 */ 结尾,并且跨多行。文档注释必须紧接在类、接口、方法或字段定义之前。
/**
This is a documentation comment.
This class is written to show the use of documentation comment in Java.
This program displays the text "Welcome to Tutorials Point" in the console.
*/
public class DocumentationComment {
public static void main(String args[]) {
System.out.println("Welcome to Tutorials Point");
}
}Welcome to Tutorials Point
以上就是如何在Java代码中添加不同的注释?的详细内容,更多请关注php中文网其它相关文章!
java怎么学习?java怎么入门?java在哪学?java怎么学才快?不用担心,这里为大家提供了java速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号