123jgh

导航

 

2022年10月12日

摘要: import java.util.Arrays;public class Demo06 { public static void main(String[] args) { int[] a = {1,2,5555,674,22}; //System.out.println(a); //打印数组元素 阅读全文
posted @ 2022-10-12 16:13 江江要努力 阅读(29) 评论(0) 推荐(0)
 
摘要: public class Demo05 { public static void main(String[] args) { /*[5][2] 面对对象 1,2 array[0] 2,3 array[1] 3,4 array[2] 4,5 array[3] 5,6 array[4] */ int[] 阅读全文
posted @ 2022-10-12 16:11 江江要努力 阅读(28) 评论(0) 推荐(0)
 
摘要: public class Demo04 { public static void main(String[] args) { int[] arrays = {1, 2, 3, 4, 5, 6}; /*JDK1.5:没有下标 for (int array : arrays) {//array.for 阅读全文
posted @ 2022-10-12 16:01 江江要努力 阅读(28) 评论(0) 推荐(0)
 
摘要: public class Demo03 { public static void main(String[] args) { int[] arrays = {1,2,3,4,5,6}; //打印全部的数组长度 for (int i = 0;i < arrays.length;i++){ System 阅读全文
posted @ 2022-10-12 15:58 江江要努力 阅读(22) 评论(0) 推荐(0)
 
摘要: public class Demo01 { //变量的类型 变量的名字 = 变量的值; //数组类型 public static void main(String[] args) { int[] nums;//1声明一个数组, (数组并不存在) nums = new int[5];//2创建一个数组 阅读全文
posted @ 2022-10-12 15:57 江江要努力 阅读(115) 评论(0) 推荐(0)
 
摘要: public class HelloWorld { //psvm快捷词,单行注释 public static void main(String[] args) { //sout输出一个HelloWorld! System.out.println("com.jiang.base.HelloWorld! 阅读全文
posted @ 2022-10-12 15:47 江江要努力 阅读(50) 评论(0) 推荐(0)
 
摘要: public class Demo04 { //类变量 static static double salary = 2500; //属性:变量 /* 实例变量:从属于对象,如果不自行初始化,则输出这个类型的默认值0 0.0 u0000 布尔值:默认是false 除了8种基本类型,其余的默认值都是nu 阅读全文
posted @ 2022-10-12 15:45 江江要努力 阅读(39) 评论(0) 推荐(0)
 
摘要: public class Demo03 { public static void main(String[] args) { int i = 128; byte b =(byte)i;//内存溢出,数值异常(byte只能到127) double c =i; /*byte,short,char >in 阅读全文
posted @ 2022-10-12 15:41 江江要努力 阅读(57) 评论(0) 推荐(0)
 
摘要: public class Demo02 { public static void main(String[] args) { //整数拓展 进制 二进制0b 十进制 八进制0 十六进制0x int i1=12; int i2=012;//八进制0 int i3=0x12;//十六进制0x 0-9 A 阅读全文
posted @ 2022-10-12 15:38 江江要努力 阅读(52) 评论(0) 推荐(0)
 
摘要: public class Demo01 { public static void main(String[] args) { //字符 char name='国'; //字符串,string不是关键字是类 String a="hello"; //整数 int num1=15;//4字节,最常用,-2 阅读全文
posted @ 2022-10-12 15:36 江江要努力 阅读(24) 评论(0) 推荐(0)