摘要:
运算符 算数运算符 public class hello { public static void main(String[] args) { long a = 10000000L; int n = 1; short t = 4; byte u = 6; System.out.println(a+n 阅读全文
posted @ 2021-07-26 17:30
Pesson-T
阅读(45)
评论(0)
推荐(0)
摘要:
JAVA变量 变量是什么:可以变化的量。 java是一种强类型语言,每个变量都必须声明其类型。 java变量是程序中最基本的存储单位,其要素包括变量名,变量类型和变量域。 type varName [=value] [{,varName[=value]}]; 数据类型 变量名 =值;可以使用逗号隔开 阅读全文
posted @ 2021-07-26 15:53
Pesson-T
阅读(151)
评论(0)
推荐(0)
摘要:
类型转换 低-->高 byte,short,char-> int -> long -> float -> double 1.强制转换:高-->低 public class hello { public static void main(String[] args) { int i = 128; // 阅读全文
posted @ 2021-07-26 11:29
Pesson-T
阅读(33)
评论(0)
推荐(0)
摘要:
转义字符 1.制表符 // \t 制表符 System.out.println("hello \t world"); 最后控制台输出 hello world 2.换行符 // \n 换行 System.out.println("hello \n world"); 最后控制台输出 hello worl 阅读全文
posted @ 2021-07-26 10:28
Pesson-T
阅读(74)
评论(0)
推荐(0)
摘要:
标识符 1.所有的标识符都应该是以字母A-Z或a-z开头,美元符号($),或者下划线(_)开始 String Ahello = "以大写字母开头"; String ahello = "以小写字母开头"; String $hello = "以美元符号开头"; String _hello = "以下划线 阅读全文
posted @ 2021-07-26 10:27
Pesson-T
阅读(159)
评论(0)
推荐(0)
摘要:
数据类型 1.基本类型 //八大类型 //整数 int num1 = 10; //最常用 byte num2 = 120; short num3 = 123; long num4 = 30L; //long类型后面要加L //小数 float num5 = 20.1F; //float类型要加F d 阅读全文
posted @ 2021-07-26 10:27
Pesson-T
阅读(31)
评论(0)
推荐(0)
摘要:
注释 注释并不会被执行,是给写代码的人看的 1.单行注释:可以注释一行文字 public class hello { public static void main(String[] args) { //单行注释 //输出一个hello,world System.out.println("hello 阅读全文
posted @ 2021-07-26 10:25
Pesson-T
阅读(33)
评论(0)
推荐(0)

浙公网安备 33010602011771号