摘要: 变量 *java是一种强类型语言,每个变量都必须声明其类型 *java变量是程序最基本的存储单元,其要素包括变量名,变量类型,作用域 ` int a=1;//程序可读性 写三行读起来比较顺畅 int b=2; int c=3; String name ="sjy"; char x='a'; doub 阅读全文
posted @ 2021-04-27 16:58 mr42 阅读(43) 评论(0) 推荐(0)
摘要: ##类型转换## ` public class Demo04 { public static void main(String[] args) { int i=128; byte b=(byte) i;//强制转换 //内存溢出 System.out.println(i); System.out.p 阅读全文
posted @ 2021-04-27 15:32 mr42 阅读(68) 评论(0) 推荐(0)
摘要: 语法基础 数据类型 ` //整数表达 常用 int num=42;//整数类型 byte num2=20; short num3=30; long num4=30L;//后面加L //小数:浮点数 float num5=50.1F; double num1=3.44464131; //字符串 str 阅读全文
posted @ 2021-04-27 11:17 mr42 阅读(81) 评论(0) 推荐(0)