Java Take-Home-Message

bytecode 字节码

pros: A compromise between target machine code and interpreter solution: 1.VM-oriented:(Architecture neutral(中立)) offers a good cross-platform compatibility. 2. speed: machine-code > bytecode > inteprete

techs gradually developed base on bytecode :

  1. cache for hot code ->machine code ,(hot means conde snippets use more often) -> JIT
  2. all compiled machine-code ->AOT ,but machine-code quality less good (than what ?maybe lack of optimize?)

concepts recall: compiled type: compile all file to machine-code. like DB field materialized-model procedure. interpreted type: compile and run line by line . like DB field volcano-model. ![[Pasted image 20230708095334.png]]

Reflection 反射

concept: let any code snippets get any object`s data structure and functions. base on this , can we somehow dynamically let program user create a class at running time ?

Serialize 序列化

serialize concepts: convert an object to byte-sequence or convert an object to JSON,XML….. deserialize : commonly , convert a JSON to an object.

usage: 1.cross-programming-laguage procedure call. (RPC) 2.network transport 3.create object from IO(disk,network) todo: whats the basic impl of serialize ? to what kind of byte-sequence? anything could be called byte-sequence.

impl: whats the binary view of an object and JSON ? the encoder and decoder view of this. what serialize did?

Code-Robustness : Exception

Throwable:
Error:
VM-Error:
Stack Overflow
Out of Memory
Exception:
IO Exception:
EOF(End Of File) 文件越界
FileNotFound
NotHavePermission (R or W or R\W)
RuntimeException:
Arithmetic
ClassNotFound
IllegalArgument
ArrayIndexOutOfBound
UnknownType
NullPointer

Multi-Thread Communication

Basic Approach:
Mutex: 互斥锁
实现:syncronized 关键词

Java file IO

Java network IO

Recent posts

software_isolation

less than 1 minute read

Why: Some app is doing unnecessary things or even steal privacy. Monitoring user behaviour: sensitive io files,sensitive upload user privacy file. addin...

读书的Take Home Message

1 minute read

最近读书收获的Take Home Message(better into 4 mem-chunks ) : 非技术类书籍 最喜欢的序:序二 心流人生:一曲冰与火之歌 心熵:心中的信息熵状态: 混乱的时候: 潜意识里,却有多得多的念头在相互冲突,在争夺 你的注意力,在抢夺你大脑的控制权...

日清周结

less than 1 minute read

每日的计划和执行: 搜集所有todo 排序重要和紧急程度 ![[ Eisenhower_matrix.png]] 执行 分配时间片: Schedule time for things that normally distract you. Balance your work and leisur...

Live with diffcult

2 minute read

Descartes’ scientific methodology, which is a useful way to approach complex problems and seek the truth. However, I understand that sometimes you may encoun...

Communism

less than 1 minute read

“你好同志!请问列宁格勒与斯大林格勒在哪里?我在地图上找不到了” “不会再有了,同志,白匪和资本家重新骑到了我们头上,工人被赶回了工厂,农民被重新戴上了镣铐” “不落的红旗终究也要…” “同志!去东方吧!跨过那第聂伯河!翻过那乌拉尔山!在那遥远的契丹,还有那一丝红星的微光尚存”