ChaseDream
搜索
返回列表 发新帖
查看: 3944|回复: 3
打印 上一主题 下一主题

Design class

[复制链接]
跳转到指定楼层
楼主
发表于 2019-9-17 12:36:23 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
override???  所有的java 都可以; abstract 只能在method;

implement  可以好几个interface(list 继承collection
?)

OOD  设计整个程序,怎么去设计class;

答疑环境,解决问题都第一步是描述问题;  

继承 共性:base class、 基类,

一个class的内部叫nested class嵌套类,内部类; 子类或者派生类
现实生活中有问题,用code 模式化like 员工管理程序;

继承就是: base class,
implement 只能跟 interface
contra   继承 只能class( 默认class 都是;特殊的是 abstract class工具,) 例题 不想去限制算法,只想限制API




class


















收藏收藏 收藏收藏
沙发
 楼主| 发表于 2019-9-19 09:50:18 | 只看该作者
designer  problem solver~~
设计思想的
OOP programming
类和对象;
OOD:
Object Oriented Programming ,basic steps in OOD
Design patterns
More advanced examples

why learning OOD?
1. practical problems -->Model --> Code
2. Better understanding of OOP
3. How to write good code?

looc java source code designed APi good or not good?














板凳
 楼主| 发表于 2019-9-24 07:06:12 | 只看该作者
ES6  声明变量  let 和 const

console.log(flag);
var flag = 123;
//undefined

vs
console.log(flag);
let flag = 123; is not define!
let声明的变量不存在预解析



var flag = 123;
var flag= 456;
console.log(flag);
//var : 456覆盖了,
但是let声明的变量 在同一作用域内不允许重复!

ES6 引入了块级作用域
块内部定义的变量,在外部是不可以访问的
if(true){
      var flag = 123;
    let flag = 123;
}

{//这里是块级作用域;
    let  flag = 111;
    console.log(flag);//这样可以访问
}
console.log(flag);不能访问;










地板
 楼主| 发表于 2021-10-23 14:07:27 | 只看该作者
make a global plan for how this work. figure out how to solve each of these subtasks. Later on, this is sort of a general idea with algorithms, when you're developing them.What you don't want to do is write line one of the algorithm and then write line two of the algorithm and thenThree of the algorithm,
but you want to do is write the algorithm in chunks and plan out what the chunks are going to be and then go into each chunk and write that in more detail and so on.
So, develop your algorithms sort of breadth first rather than depth first, just the way that we recommend doing with fruits, write out the cases then the case.
The case delimiters分隔符 before you go into each case and fill in the details.



And the idea is that this is a smaller instance of exactly the same problem. So, the question is how do I know that this works.The same thing is true here.
I need to make sure that the problems that I'm solving by these recursive calls, really are smaller instances of exactly the same problem


But as a general rule, it's really only going to get confusing if you try to unpack that it's really important to think when you're designing the algorithm recursion is magic. As long as you follow the rules. Smaller instance of exactly the same problem. It'll work out fine. When we're generally when we're designing algorithms, we don't just want to know that we've solved the problem correctly.
您需要登录后才可以回帖 登录 | 立即注册

Mark一下! 看一下! 顶楼主! 感谢分享! 快速回复:

手机版|ChaseDream|GMT+8, 2024-12-20 07:09
京公网安备11010202008513号 京ICP证101109号 京ICP备12012021号

ChaseDream 论坛

© 2003-2023 ChaseDream.com. All Rights Reserved.

返回顶部