第二节

这里写自定义目录标题


1,字符集 8位
GB2312 16位
GDK 16位,增加了繁体字和甲骨文
Java语言采用 Unicode编码
2,内存模型

3分支语句
例;打印年某月某天。(提示,A闰年的计算方法,年数能被4整除,并且不能被100整除。或者能被400整除。B利用%运算可以判断一个数能否被另一个数整除。)
Scanner sc = new Sanner(System.in);
int year =sc.nextInt();

int month =sc.nextInt();
if(month1||month3||month5||month7||month8||month10||month12){
System.out.println(“31day”);
}
else if(month
4||month6||month9||month11){
System.out.println(“30day”);
}
else if(month
2){
if((year%40&&year%100!=0|| year%4000){
System.out.println(“29day”);
}
else{
System.out.println(“28day”);
}
else{
System.out.println(“非法月份”);
}

定义一个大写字母或者一个小写字母的方法:

char c1=’A’;
char c2=’a’;
System.out.println((int)c1);
System.out.println((int)c2);

输出结果为65,97,相差32

如何输入一个大写字母,让他转化为小写字母
char c1=’A’;
System.out.println((char)((int)c1));
System.out.println(Character.toLowerCase(‘B’));

博客体现与原代码有所出入,所以选择用截图的方式体现。第二节第二节