编写转义字符:78页
编写转义字符:78页
system.out.println("\\") 输出\
package com.chongrui.test;
public class Gess {
public static void main(String[] args) {
// TODO Auto-generated method stub
char chart1='\\';
char chart2='\u2605';
System.out.println("输出反斜杠:"+chart1);
System.out.println("输出五角星"+chart2);
}
}
输出反斜杠:\
输出五角星★
package com.chongrui.test;
public class Gess {
static final double PI = 3.14;
static int age = 23;
public static void main(String[] args) {
// TODO Auto-generated method stub
char chart1='\\';
char chart2='\u2605';
System.out.println("输出反斜杠:"+chart1);
System.out.println("输出五角星"+chart2);
int i = 10;
System.out.println("i的初始值"+i);
i=100;
System.out.println("i现在的值"+i);
//声明常量的方法 final 数据类型 常量名称【=值】
//比如:final double PI = 31.241526F; final boolean BOOL = true
final int number;
number = 1234;
age = 888;
System.out.println("常量PI的值 "+PI);
System.out.println("number的值 "+number);
System.out.println("int型的age值"+age);