From 81d28657c758af11978dcec562ae73418ebcba2b Mon Sep 17 00:00:00 2001 From: yennanliu Date: Mon, 13 Nov 2023 18:21:59 +0800 Subject: [PATCH] update/add faq, add pic --- doc/faq/faq_java.md | 48 +++++++++++++++++- doc/faq/java_multi_thread.md | 7 +++ doc/pic/basic_ref_data_type.jpeg | Bin 0 -> 23963 bytes .../src/main/java/dev/workSpace2.java | 20 ++++++-- 4 files changed, 68 insertions(+), 7 deletions(-) create mode 100644 doc/faq/java_multi_thread.md create mode 100644 doc/pic/basic_ref_data_type.jpeg diff --git a/doc/faq/faq_java.md b/doc/faq/faq_java.md index 60f4562e..491b7743 100644 --- a/doc/faq/faq_java.md +++ b/doc/faq/faq_java.md @@ -1,4 +1,4 @@ -# JAVA FAQ +# Java FAQ ### 0) Ref @@ -6,7 +6,51 @@ - https://cloud.tencent.com/developer/article/2183300 -### Java basic data type VS reference data type **** ? +### Java basic data type (基本數據類型) VS reference data type (引用數據類型) **** ? + + + +- basic data type : byte, short, int, long, float, dobule, char, boolean ... +- reference data type : Class, interface, Array + +- Note : + - basic data type : + - "==" : compare attr (value) + - equals : compare attr (value) + + - reference data type : + - "==" : compare storage address + - equals : + - NOT override : Still compare storage address (same as "==") + - override : compare attr (value) + - all class are child class of Object class + + ```java + // java + public boolean equals(Object obj) { + return (this == obj); + } + ``` + + ```java + // java + + // new Class : use a new storage in heap (內存) + String a = new String("123"); + String b = new String("123"); + + System.out.println(a==b); // false ( "new" will use new address in internal storage) + + // without new : will fetch from constant pool + String c = b; + + System.out.println(c==b); // true ( c will fetch from constant pool (常量池)) + ``` + +- https://blog.csdn.net/weixin_45658089/article/details/120248191 +- https://javaguide.cn/java/basis/java-basic-questions-02.html#object-%E7%B1%BB%E7%9A%84%E5%B8%B8%E8%A7%81%E6%96%B9%E6%B3%95%E6%9C%89%E5%93%AA%E4%BA%9B + +### String、StringBuffer、StringBuilder ? ### Exception VS Error ? diff --git a/doc/faq/java_multi_thread.md b/doc/faq/java_multi_thread.md new file mode 100644 index 00000000..843a243f --- /dev/null +++ b/doc/faq/java_multi_thread.md @@ -0,0 +1,7 @@ +# Java Multi-thread FAQ + +- https://javaguide.cn/java/concurrent/java-concurrent-questions-01.html +- https://javaguide.cn/java/concurrent/java-concurrent-questions-02.html +- https://javaguide.cn/java/concurrent/java-concurrent-questions-03.html + +### Java multi thread ? \ No newline at end of file diff --git a/doc/pic/basic_ref_data_type.jpeg b/doc/pic/basic_ref_data_type.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..0ccf420ef297c3b136241b878c217a6a75beb090 GIT binary patch literal 23963 zcmc$_by!>7wmuq)gcdIp3PB46THGBPC{Unii@Qs3hafGqNO5;*(H4ShvEuH9;1VFX zTky;G{myU8J>TAEpXdH@N1m)_tube^W@hG`YrO9}=H1lY5`a)%MotERhK2?(x_<%g zW&u(FEDQ_`ObjecOst1k_ir3*EG%ps+((aa9zDV(#QoC? zfChMg{zr5FW@wlXFtE^p*!QK%ga9;*2LOx*SeQU;AP@un&)OK6L|BjMxQL$tNw~qP z#!u*-Tt7;x#gtc69*{Ed@bR0teI;`ah;3~fea!A0^UoUhWkeW{=`e}8NS=XJ>A8(RKH)KO8a=q1 z0pOzF*Cs+I0!RRE)IR+GWdTHldLA%44416fmtN5(2K&)h{=FE-Su3}NOlc?Conu4? z7rxC)fwYJKFgVl;9H-PZ!vC>Kxu4o)U#n~KU3Ii=v4b$a!$@KVz)9OyX@vj%N6OwZ zBznmBpm~^R$)+WCNT!P5x_jW){%92_!LHSYbl5>Oy6yM;ESzLDFEB%|JpiumsN~7>^P&ffpHX}9!2ZqCV|UU7mBInfnxBs4TKlHpW?pvLbOu~ft=S< zyXgSd41atP&R5;SRSjz?jh)>)JAob{f-Ce}8bvA<<9rr~ywk~mA%DG|FZ-0au9Pr3 z;F!rG?V@4oLrIGBb=N112~AUD{;y{GaouZDOiOl_Q1oL7tcfh$gTn?1NlGY_@Rp=x z-t#T_6P^PY@$z_F#M)H)?eiL=LOYpRQr$re=+@yOP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C2Iy-A+Ik~>@h}&CfbXAsxUF^bV zBUgnZSaelxO_&y2-o3(AJ72*^(`PaB{K6RZe@XS85&oeI{ZAkLM?>g^pHMl-KZd|- Rzb1HpV1N9p-U$9a_Fn;uuvq{A literal 0 HcmV?d00001 diff --git a/leetcode_java/src/main/java/dev/workSpace2.java b/leetcode_java/src/main/java/dev/workSpace2.java index 8373bd9b..f89c2ccd 100644 --- a/leetcode_java/src/main/java/dev/workSpace2.java +++ b/leetcode_java/src/main/java/dev/workSpace2.java @@ -12,12 +12,22 @@ public static void main(String[] args) { // // } - String x = "abcd"; - System.out.println(x.substring(1,3)); - StringBuilder sb = new StringBuilder(x.substring(1,3)); - System.out.println(sb.reverse()); +// String x = "abcd"; +// System.out.println(x.substring(1,3)); +// StringBuilder sb = new StringBuilder(x.substring(1,3)); +// System.out.println(sb.reverse()); +// +// System.out.println(x.substring(x.length()-1, x.length())); + + + String a = new String("123"); + String b = new String("123"); + + System.out.println(a==b); // false ( "new" will use new address in internal storage) + + String c = b; - System.out.println(x.substring(x.length()-1, x.length())); + System.out.println(c==b); // true ( c will fetch from constant pool (常量池)) }