CY摸魚java筆記002
練習(xí)
public class Test01 {
????public static void main(String [] args){
????????String brand="品牌:CY";
????????double weight=199;
????????String type="打工人";
????????int price=666;
????????System.out.println(brand);
????????System.out.println(weight);
????????System.out.println(type);
????????System.out.println(price);
????????}
}
public class Test02 {
????public static void main(String [] args){
? ? ? ?int A=80;
???????int B;
???????A=B;
? ? ? ?System.out.println(B);
????????}
}
基本的算術(shù)運(yùn)算符? + - * / %


1.+可以是員工是一個(gè)運(yùn)算符,也可以是一個(gè)連接符
2.兩個(gè)數(shù)據(jù)是非數(shù)值類型時(shí),+作為連接符
3.一個(gè)數(shù)值和一個(gè)非數(shù)值時(shí),+作為連接符
4.兩個(gè)都是數(shù)值的時(shí)候,+作為運(yùn)算符
%,取模(取余)


標(biāo)簽: