摘要: package com.oop; import com.oop.demo03.Pet; public class Application { public static void main(String[] args) { Pet dog = new Pet(); dog.name = "旺财"; 阅读全文
posted @ 2020-12-18 06:12 Py-JS 阅读(46) 评论(0) 推荐(0) 编辑
摘要: 属性加方法是类 package com.oop.demo01; import java.io.IOException; //Demo01 类 public class Demo01 { //main 方法 public static void main(String[] args) { } /* 修 阅读全文
posted @ 2020-12-16 06:20 Py-JS 阅读(60) 评论(0) 推荐(0) 编辑
摘要: 多维数组决定数组中有多少列 package com.xiaojie.arrary; public class ArrayDemo05 { public static void main(String[] args) { //[4][2] 四行两列 /* 1,2 array[0] 2,3 array[ 阅读全文
posted @ 2020-12-05 20:48 Py-JS 阅读(77) 评论(0) 推荐(0) 编辑
摘要: package com.xiaojie.arrary; public class ArraryDemo01 { //变量的类型 变量的名字 = 变量的值 //数组类型 public static void main(String[] args) { int[] nums; //1.声明一个数组 in 阅读全文
posted @ 2020-12-04 22:19 Py-JS 阅读(61) 评论(0) 推荐(0) 编辑
摘要: System.out.printIn() 类.方法.对象 public static void main() public 修饰符 static 类变量 void 返回值类型 void代表不返回东西 main 方法名 package com.xiaojie.method; public class 阅读全文
posted @ 2020-12-03 06:14 Py-JS 阅读(78) 评论(0) 推荐(0) 编辑
摘要: package com.xiaojie.struct; public class WhileDemo03 { public static void main(String[] args) { //计算1+2+3+..+100=? int i = 0; int sum = 0; while (i<=1 阅读全文
posted @ 2020-11-30 21:49 Py-JS 阅读(65) 评论(0) 推荐(0) 编辑
摘要: package com.xiaojie.struct; import java.util.Scanner; public class IfDemo01 { public static void main(String[] args) { Scanner scanner = new Scanner(S 阅读全文
posted @ 2020-11-30 20:38 Py-JS 阅读(81) 评论(0) 推荐(0) 编辑
摘要: package com.xiaojie.scanner; import java.util.Scanner; public class Demo01 { public static void main(String[] args) { //创建一个扫描器对象,并用于接收键盘数据 Scanner sc 阅读全文
posted @ 2020-11-30 05:58 Py-JS 阅读(54) 评论(0) 推荐(0) 编辑
摘要: package operator; public class Demo01 { public static void main(String[] args) { //二元运算符 int a = 10; int b = 20; int c = 30; int d = 40; System.out.pr 阅读全文
posted @ 2020-11-29 07:52 Py-JS 阅读(62) 评论(0) 推荐(0) 编辑
摘要: 在方法里面的叫局部变量;在方法外边的叫实例变量。 static声明的变量叫类变量。 public class Demo08 { //类变量 static static double salary = 2500; //属性:变量 //实例变量:从属于对象:如果不自行初始化,这个类型的默认值 0 0.0 阅读全文
posted @ 2020-11-29 06:47 Py-JS 阅读(55) 评论(0) 推荐(0) 编辑