java第四课时

1.加法符号的综合运用;(字符+数值)
2.字符串相加;
3.自增、自减(单独使用)
4.学习+=、-=、*=、/=、%=等符号的用法
5.学习a++(一元运算符)、4+6(二元运算符)、?(三元运算符)
public class ZhongFa{
public static void main (String[] args){

char var1='A';
System.out.println(var1+1);
System.out.println(var1);

System.out.println("Hello"+"huagong");
System.out.println("Hello"+"20");
System.out.println("Hello"+20);
System.out.println("Hello20"+50);
System.out.println("Hello"+(20+50));

System.out.println("==========");

int num1=10;
System.out.println(num1);
num1++;
System.out.println(num1);
++num1;
System.out.println(num1);
System.out.println("==========");

int num2=10;
System.out.println(num2);
System.out.println(num2++);
System.out.println(++num2);
System.out.println("==========");

int num3=10;
int result4=num3--;
System.out.println(result4);
System.out.println(num3);
System.out.println("==========");

int num4=10;
int num5=20;
int result5=++num4+num5--;
System.out.println(result5);
System.out.println(num4);
System.out.println(num5);
System.out.println("==========");

int num6=10;
num6+=10;
System.out.println(num6);

num6%=3;
System.out.println(num6);

byte num7=10;
num7+=10;
System.out.println("==========");

System.out.println(10>3);
System.out.println(10<3);

int num8=10;
int num9=10;
System.out.println(num8>=num9);
System.out.println(num8<=num9);
System.out.println(num8=num9);
System.out.println("=========");

System.out.println(3<4 && 10>8);

System.out.println(true && true);
System.out.println(true && false);
System.out.println(false && false);

System.out.println(true || true);
System.out.println(false || false);
System.out.println(false || true);

System.out.println(!true);
System.out.println(!false);

System.out.println("==========");

int num10=10;
System.out.println(3<4 && num10>10);
System.out.println(3<4 && num10>=10);
System.out.println(3<4 && num10++>10);
System.out.println(num10);
System.out.println(3<4 && ++num10>10);
System.out.println(num10);
System.out.println("==========");
num10=10;
System.out.println(3>4 && num10>10);
System.out.println(3>4 && num10>=10);
System.out.println(3>4 && num10++>10);
System.out.println(num10);
System.out.println(3>4 && ++num10>10);
System.out.println(num10);
System.out.println("==========");
int num11=10;
System.out.println(3<4 || num10>10);
System.out.println(3<4 || num10>=10);
System.out.println(3<4 || num10++>10);
System.out.println(num11);
System.out.println(3<4 || ++num10>10);
System.out.println(num11);
System.out.println("==========");
num11=10;
System.out.println(3>4 || num10>10);
System.out.println(3>4 || num10>=10);
System.out.println(3>4 || num10++>10);
System.out.println(num11);
System.out.println(3>4 || ++num10>10);
System.out.println(num11);
num11=10;
System.out.println(3>4 || ++num11>10);
System.out.println(num11);
System.out.println("===========");

int num12=10;
int num13=20;

int max=num12>num13?num12:num13;
System.out.println(max);

int min=num12>num13?num13:num12;
System.out.println(min);
            System.out.println("2020080605034");

}
}
在这里插入图片描述
在这里插入图片描述
经历了几天的学习稍微有点思路了,加油!

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值