java入门篇

MyEclipse 8.5编辑器

package second;



public class test {
public static void main(String[] args) {
//单行注释System.out.println("java practice1");

/*多行
            注释*/

/**
* 文档注释
* @param args
*/
/*标识符:在Java中,对于程序的命名
* 可以是26个字母(大小写)+0-9
* 符号:_,$
* 开头不能是数字
*/

/*System.out.println("java practice1");
System.out.println("asdfghjkl");*/
// 变量类型 变量名=变量值
//String str="hello java!"; //声明(创建)一个变量
//System.out.println(str);
//str="welcome";
//System.out.println(str);
//final关键字 常量类型 常量名=常量值
final String str="hello java!"; //声明(创建)一个常量
System.out.println(str);
//str="welcome";
System.out.println(str);

final String str100="f S str";//声明(创建)一个常量
System.out.println(str100);
//System.out.println(str100);

/*
int cnt=0;//声明(创建)整型变量
float price=0.0f;//声明(创建)浮点型变量
double score=68.3;//声明(创建)双雕浮点型该变量
char c='a';//声明(创建)字符型变量     (单引号,单个字符)
String str1="welcome";//声明(创建)字符串常量    (双引号,多个字符)
System.out.println(cnt);
System.out.println(price);
System.out.println(score);
System.out.println(c);
System.out.println(str1);
*/
}
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值