week1-Java base
About 1 min
Learning philo
Pros and Cons Using Typing
The Good:
- Catches certain types of errors, making it easier for the programmer to debug their code.
- Type errors can (almost) never occur on end user's computer.
- Makes it easier to read and reason about code.
- Code can run more efficiently, e.g., no need to do expensive runtime type checks.
The Bad:
- Code is more verbose.
- Code is less general, e.g., there had to be two different
largerfunctions earlier.
为什么要转成 XX.class
- class file has been type checked. Distributed code is safer.
- .class files are ‘simpler’ for machine to execute. Distributed code is faster.
- Minor benefit: Protects your intellectual property. No need to give out source.
static vs non-static
- you'd better access static things by class name and access non-static things by specific instance.
•A variable or method defined in a class is also called a member of that class.
•Static members are accessed using class name, e.g. Dog.binomen.
•Non-static members cannot be invoked using class name: ~~Dog.makepaise()~
Static methods must access instance variables via a specific instance, e.g. dl.

Why java Classes and Static method
Some obvious questions arise:
●Why does Java force us to use classes?
●Why have static methods at all?
The reason: To take choices away from the programmer.
- Fewer choices means fewer ways to do things.
- Example: Declaring a method static means you can’t use any instance variables in that method.
- Fewer ways to do things often means less complexity.
Help method
什么是 Help Method▶️
