
声明常量:
常量在整个程序中只能赋值一次
final 数据类型 常量名称=值
final doule PI=3.1415926;整数+字符串➡连接在一起
int i=1; String j="5";
得到结果:
x+y=15主方法:
public static void main(String[] args)输出:
System.Out.print("");
System.Out.println("");//输出后换行
输入-----Scanner:
Scanner 名称=new Scanner(system.in)
Scanner sc = new Scanner(System.in); int n = sc.nextInt();//整数 String a=sc.nextLine();//字符串 sc.colse();//关闭选择结构: if语句:
i
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)