上一页 1 2 3 4 5 6 7 8 ··· 16 下一页
摘要: Goods 商品类 package com.heima.Shop; public class Goods { private String name; private double price; private int buyNumber; //生成 无参构造器 public Goods() { } 阅读全文
posted @ 2022-06-22 23:48 还有什么值得拥有 阅读(9) 评论(0) 推荐(0) 编辑
摘要: Student类 package com.heima.encapsulation; public class Student { //private 私有 只有在Student类中可以使用,外界不可以读取 private int age; //暴露出外界读取age的方法 public int get 阅读全文
posted @ 2022-06-22 19:48 还有什么值得拥有 阅读(79) 评论(0) 推荐(0) 编辑
摘要: 无参构造器 与有参构造器 (任何类定义出来,默认就自带了有参构造器,写不写都有.一定定义了有参构造器,无参构造器就没了,此时就需要自己写一个无参构造器了) package com.heima.Car; public class Car { String name; double price; //无 阅读全文
posted @ 2022-06-22 17:42 还有什么值得拥有 阅读(15) 评论(0) 推荐(0) 编辑
摘要: Car类 package com.heima.Object; public class Car { //属性(成员变量) String name; double price; //行为(方法) public void start(){ System.out.println(name+",价格是:"+ 阅读全文
posted @ 2022-06-22 14:30 还有什么值得拥有 阅读(52) 评论(0) 推荐(0) 编辑
摘要: 案例一 买飞机票 import java.util.Scanner; public class FuncDemo6 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.p 阅读全文
posted @ 2022-06-21 23:09 还有什么值得拥有 阅读(12) 评论(0) 推荐(0) 编辑
摘要: 定义方法的完整格式 public class MethodsDemo1 { public static void main(String[] args) { //目标:学习方法的完整定义格式,并理解其调用和执行流程 int rs= add(199,22); System.out.println(rs 阅读全文
posted @ 2022-06-21 17:45 还有什么值得拥有 阅读(14) 评论(0) 推荐(0) 编辑
摘要: 数组使用常见的问题 Debug工具的使用 阅读全文
posted @ 2022-06-21 15:13 还有什么值得拥有 阅读(13) 评论(0) 推荐(0) 编辑
摘要: arr+fori +回车键 快速敲除 数组遍历for循环指令 值+.sout+回车 快速敲除控制台打印指令 alt+回车键 强制转换 alt+回车键 (新写的方法 还没创建)自动帮你创建方法 ctrl+alt+t 键 选择循环语句(快速创建) /**+回车 生成标准注释 alt+insert 快速调 阅读全文
posted @ 2022-06-21 00:29 还有什么值得拥有 阅读(83) 评论(0) 推荐(0) 编辑
摘要: 静态初始化数组 public class ArrayDemo { public static void main(String[] args) { //静态初始化数组 //数据类型 [] 数据名称=new 数据类型[]{元素1,元素2,......} //全写 int [] arr1=new int 阅读全文
posted @ 2022-06-21 00:28 还有什么值得拥有 阅读(15) 评论(0) 推荐(0) 编辑
摘要: 猜数字游戏 import java.util.Random; import java.util.Scanner; public class MathRandom { public static void main(String[] args) { //导包 实例化Random 类 Random r= 阅读全文
posted @ 2022-06-20 23:14 还有什么值得拥有 阅读(19) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 16 下一页