程序设计实验与应用
文章平均质量分 90
大学课程
常力力
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
一个电子表
这节课以 BlueJ 的一个电子表为例: 新建一个ClockDisplay 的对象后, 点击它, 里面有一个实例变量: String displayString. 现在显示的是 “00:00”, 也代表在现实中电子表会显示的字符串 在 Java 中, 我们要想跟 object 互动 就需要 使用 method: 里面只有三个 methods, 是个很简单的 interface. getTime() 和 setTime(int hour, int minute) 就是我上文讲到的 accessor 和原创 2021-10-30 15:47:56 · 324 阅读 · 0 评论 -
Varialbles & Scope & return
Variables 变量 Java 中有三种变量 Fields (instance variables); They store values through the life of an object. They are accessible throughout the class. Parameters (temporory variables); They receive values from outside the method. They help a method complete原创 2021-10-25 05:45:36 · 570 阅读 · 0 评论 -
overloading 重载 & String concatenation & BlueJ 的 Code Pad
Overloading 重载 这是一个打票机 import lang.stride.*; public class TicketMachine { /* The price of a ticket from this machine.*/ private int price; /* The amount of money entered by a customer so far.*/ private int balance; /* The total amount原创 2021-10-24 12:03:00 · 245 阅读 · 0 评论 -
类&方法的结构
Class 类 Basic Class Structure The inner contents of a class: [Fields](#fields 变量) [Constructors](#constructors 构造器) [Methods](#methods 方法) The name of a class always starts with a capital letter. If the name is a compound name, like ticket machine, it原创 2021-10-24 09:33:39 · 273 阅读 · 0 评论
分享