《深入理解Java虛擬機》- Java虛擬機是如何載入Java類的?

来源:https://www.cnblogs.com/chenscript/archive/2019/08/15/11361111.html
-Advertisement-
Play Games

Java虛擬機是如何載入Java類的? 這個問題也就是面試常問到的Java類載入機制。在年初面試百戰之後,菜鳥喜鵲也是能把這流程倒背如流啊!但是,也只是字面上的背誦,根本就是像上學時背書考試一樣。 tonight ! 我們把它映射到實戰里,看看如何用代碼說明這個流程。 ready! go! 在這之前 ...


 

Java虛擬機是如何載入Java類的?  這個問題也就是面試常問到的Java類載入機制。在年初面試百戰之後,菜鳥喜鵲也是能把這流程倒背如流啊!但是,也只是字面上的背誦,根本就是像上學時背書考試一樣。

tonight ! 我們把它映射到實戰里,看看如何用代碼說明這個流程。

ready! go!  ----------------在這之前還是搞點理論吧,不然又要先去百度載入機制流程了。

一、類載入機制(理論部分)

 類載入機制有三大過程:載入、鏈接、初始化。其中鏈接又細分為驗證、準備及解析。

Java語言的類型分為兩大類:基本類型和引用類型。Java的基本類型是由Java虛擬機預先定義好的。而引用類型又分為:數組類、類、介面、泛型參數。在JVM中,只存在數組類、類、介面三類,而數組類是直接由Java虛擬機直接生成的,其他兩類則有位元組流而來。

位元組流又是怎麼來呢?最常見的還是從位元組碼文件而來(還可以從網路等而來)。所以,我就以位元組碼文件分析一下載入機制。

1.載入

  載入是指查找位元組流,並據此創建類的過程。對於數組類來說,它們是可以由Java虛擬機直接生成。而其他兩類,卻需要藉助類載入器,Java虛擬機才能完成查找位元組流的工作。

類載入器與類的關係就像是UI與效果圖一樣,需要將業務需求翻譯成效果圖。美麗的UI就是類載入器,效果圖就是類。

類載入器有一個模型:雙親委派

雙親委派模型是每次收到類載入請求時,先將請求委派給父類載入器完成,如果父類載入器無法完成載入,那麼子類嘗試自己載入

類載入器分為三種,啟動類載入器、擴展類載入器、應用類載入器

其中,

啟動類載入器(Application ClassLoader)是負責載入最為基礎、最為重要的類,即載入<JAVA_HOME>\lib目錄下核心庫

擴展類載入器的父類載入器是啟動類載入器,擴展類載入器負責載入相對次要、但又通用的類,即載入<JAVA_HOME>\lib\ext目錄下擴展包

應用類載入器的父類載入器是擴展類載入器,應用類載入器負責載入應用程式路徑下的類,即用戶路徑(classpath)上指定的類庫

這三者類載入器的關係可以這樣描述:

每當類載入器接收到載入請求時,它會先將請求轉發給父類載入器,在父類載入器中沒有找到需要的類的情況下,該載入器才會嘗試去載入。

比如,應用載入器接收到載入請求, 會先去找父類載入器(擴展類載入器)里有沒有需要的類,但該擴展類載入器頂頭還有父類載入器(啟動類載入器), 所以還要去啟動類載入器中查找是否存在需要的類,如果不存在,那擴展類載入器就會自己載入需要的類,然後把引用傳遞給應用載入器。

類載入器還有一個功能,就是提供命名空間的作用。

在Java虛擬機中,類的唯一性是由類載入器實例以及類的全名一同確定的。即便是同一串位元組流,經過不同的類載入器載入,也會得到兩個不同的類。(這裡可以讀者自己實現一下,用兩個擴展類載入器載入同一個類,然後列印一下類信息就可以驗證了)

 

2.鏈接

 鏈接:將創建成的類合併至Java虛擬機中,使之能夠執行的過程。(這裡是下麵代碼要驗證一個步驟)

 鏈接分為驗證、準備、解析。

 驗證的目的是為了讓被載入的類能夠滿足Java虛擬機的約束。(關於約束條件,今天暫時不講。)

 準備的目的是為了被載入類的靜態欄位分配記憶體。(僅僅是分配記憶體,並沒有在記憶體中寫東西)除此之外,有些Java虛擬機還會用來實現虛方法的動態綁定的方法表。

 下一步就是我們鏈接的重要步驟--解析

 對於一個方法的調用,編譯器會解析一個符號,這個符號能夠無歧義地定位到具體的目標上。這個符號包含目標方法所在類的名字、目標方法的名字、接收的參數類型以及返回值類型的符號引用。

如果符號引用指向一個未被載入的類、欄位、方法,那麼這個解析將觸發載入功能。

3.初始化

      初始化:為標記為常量值的欄位賦值,以及執行<clinit>方法的過程。

  只有初始化完成之後,類才正式成為可執行的狀態。

那初始化這個步驟是什麼時候執行呢?

   JVM規範枚舉了下述多種觸發初始化的情況:

 

理論部分講解完了。(參考鏈接:https://time.geekbang.org/column/article/11523)

 

二、類載入機制(Linux查看位元組碼)

  在這,主要是因為網上都是一大串的理論描述,看得也是半信半疑。還不如拿出代碼來,讓自己也心服口服了。

talk is cheap,show the code!

1.classloader

輸出如下:

結果很驚人,為什麼父類載入器的父類載入器(我自己取名為爺爺類載入器。。),照理論來說,應該列印的是bootstrapClassLoader。 其實是它隱身了。貼一下代碼里的一段註釋:

* Returns the parent class loader for delegation. Some implementations may
* use <tt>null</tt> to represent the bootstrap class loader. This method
* will return <tt>null</tt> in such implementations if this class loader's
* parent is the bootstrap class loader.

  翻譯黃色的句子就是:如果父類載入器是啟動類載入器,則將返回null

但還是沒解決怎麼找bootstrapClassLoader啊。

它實際上不是 java.lang.ClassLoader的子類,而是由JVM自身實現的,我們可以通過這個方法得到實現的類路徑。

URL[] urls=sun.misc.Launcher.getBootstrapClassPath().getURLs();

2.鏈接

3.初始化

1.編譯的單例類:Singleton.java

public class Singleton{
 private Singleton(){}
 private static class LazyHolder{
    static final Singleton INSTANCE = new Singleton();
    static{
      System.out.println("LazyHolder.<clinit>");
    }
 }
 public static Object getInstance(boolean flag){
  if(flag) return new LazyHolder[2];
  return LazyHolder.INSTANCE;
 }
 public static void main(String... args){
  System.out.println("---");
  getInstance(true);
  System.out.println("---");
  getInstance(false);
 }
}

2.編譯並運行

[root@localhost tmp3]# javac Singleton.java 
[root@localhost tmp3]# java Singleton
---
---
LazyHolder.<clinit>

3.查看位元組碼文件(用的新指令:java -verbose:class Singleton)

結合2,3的輸出,我想,我該講點啥。

在兩段“-----”中,如果沒有列印載入信息,我們就以為是連續輸出了。但是並沒有。根據載入信息來看,中間還會載入Singleton$LazyHolder這個內部類,而這一步,對應的就是getInstance(true);。說明瞭啥?說明瞭前面理論部分的鏈接的最後一句話:

如果符號引用指向一個未被載入的類、欄位、方法,那麼這個解析將觸發載入功能。

這裡註意的是,僅僅調用了載入功能而已,這裡只完成了創建類而已,並沒有讓它繼續進行鏈接和初始化功能。所以在這裡,也就不會出現列印“LazyHolder.<clinit>”的字樣。

當使用到了getInstance(true)的時候,由於需要使用到“LazyHolder.INSTANCE;”這個靜態常量,而它又與new 構造器方法相連通,此時就滿足了理論中初始化的解釋:

2.當遇到用以新建目標類實例的new指令時,初始化new指令的目標類
3.當遇到訪問靜態欄位的指令時,初始化該靜態欄位所在的類

在這,大家應該也有疑問:getInstance(false)的時候也有new啊。但是,false時候的new,只是new數組,數組裡裝的只是載入時候生成的類引用。

大家還可以看下麵class位元組碼就知道,註釋那裡就標記著很清楚是類引用而已。

  Singleton.class

  public static java.lang.Object getInstance(boolean);
    descriptor: (Z)Ljava/lang/Object;
    flags: ACC_PUBLIC, ACC_STATIC
    Code:
      stack=1, locals=1, args_size=1
         0: iload_0
         1: ifeq          9
         4: iconst_2
         5: anewarray     #3       // class Singleton$LazyHolder
         8: areturn
         9: getstatic     #4       // Field Singleton$LazyHolder.INSTANCE:LSingleton;
        12: areturn
      LineNumberTable:
        line 11: 0
        line 12: 9
      StackMapTable: number_of_entries = 1
        frame_type = 9 /* same */

  public static void main(java.lang.String...);
    descriptor: ([Ljava/lang/String;)V
    flags: ACC_PUBLIC, ACC_STATIC, ACC_VARARGS
    Code:
      stack=2, locals=1, args_size=1
         0: getstatic     #5                  // Field java/lang/System.out:Ljava/io/PrintStream;
         3: ldc           #6                  // String ---
         5: invokevirtual #7                  // Method java/io/PrintStream.println:(Ljava/lang/String;)V
         8: iconst_1
         9: invokestatic  #8   // Method getInstance:(Z)Ljava/lang/Object;
        12: pop
        13: getstatic     #5   // Field java/lang/System.out:Ljava/io/PrintStream;
        16: ldc           #6   // String ---
        18: invokevirtual #7   // Method java/io/PrintStream.println:(Ljava/lang/String;)V
        21: iconst_0
        22: invokestatic  #8   // Method getInstance:(Z)Ljava/lang/Object;
        25: pop
        26: return
      LineNumberTable:
        line 15: 0
        line 16: 8
        line 17: 13
        line 18: 21
        line 19: 26

  Singleton(Singleton$1);
    descriptor: (LSingleton$1;)V
    flags: ACC_SYNTHETIC
    Code:
      stack=1, locals=2, args_size=2
         0: aload_0
         1: invokespecial #1                  // Method "<init>":()V
         4: return
      LineNumberTable:
        line 1: 0
}

 

可以看到,在getInstance中,那麼#3 和#4 對應的是啥

 

現在,

看了例子之後,大家應該也對類載入機制有了一點點瞭解了吧。 

附:java -verbose:class Singleton 顯示的全部信息

  1 [root@localhost tmp3]# java -verbose:class Singleton
  2 [Opened /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
  3 [Loaded java.lang.Object from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
  4 [Loaded java.io.Serializable from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
  5 [Loaded java.lang.Comparable from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
  6 [Loaded java.lang.CharSequence from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
  7 [Loaded java.lang.String from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
  8 [Loaded java.lang.reflect.AnnotatedElement from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
  9 [Loaded java.lang.reflect.GenericDeclaration from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 10 [Loaded java.lang.reflect.Type from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 11 [Loaded java.lang.Class from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 12 [Loaded java.lang.Cloneable from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 13 [Loaded java.lang.ClassLoader from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 14 [Loaded java.lang.System from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 15 [Loaded java.lang.Throwable from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 16 [Loaded java.lang.Error from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 17 [Loaded java.lang.ThreadDeath from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 18 [Loaded java.lang.Exception from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 19 [Loaded java.lang.RuntimeException from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 20 [Loaded java.lang.SecurityManager from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 21 [Loaded java.security.ProtectionDomain from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 22 [Loaded java.security.AccessControlContext from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 23 [Loaded java.security.SecureClassLoader from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 24 [Loaded java.lang.ReflectiveOperationException from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 25 [Loaded java.lang.ClassNotFoundException from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 26 [Loaded java.lang.LinkageError from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 27 [Loaded java.lang.NoClassDefFoundError from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 28 [Loaded java.lang.ClassCastException from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 29 [Loaded java.lang.ArrayStoreException from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 30 [Loaded java.lang.VirtualMachineError from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 31 [Loaded java.lang.OutOfMemoryError from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 32 [Loaded java.lang.StackOverflowError from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 33 [Loaded java.lang.IllegalMonitorStateException from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 34 [Loaded java.lang.ref.Reference from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 35 [Loaded java.lang.ref.SoftReference from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 36 [Loaded java.lang.ref.WeakReference from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 37 [Loaded java.lang.ref.FinalReference from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 38 [Loaded java.lang.ref.PhantomReference from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 39 [Loaded sun.misc.Cleaner from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 40 [Loaded java.lang.ref.Finalizer from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 41 [Loaded java.lang.Runnable from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 42 [Loaded java.lang.Thread from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 43 [Loaded java.lang.Thread$UncaughtExceptionHandler from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 44 [Loaded java.lang.ThreadGroup from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 45 [Loaded java.util.Map from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 46 [Loaded java.util.Dictionary from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 47 [Loaded java.util.Hashtable from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 48 [Loaded java.util.Properties from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 49 [Loaded java.lang.reflect.AccessibleObject from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 50 [Loaded java.lang.reflect.Member from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 51 [Loaded java.lang.reflect.Field from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 52 [Loaded java.lang.reflect.Parameter from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 53 [Loaded java.lang.reflect.Executable from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 54 [Loaded java.lang.reflect.Method from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 55 [Loaded java.lang.reflect.Constructor from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 56 [Loaded sun.reflect.MagicAccessorImpl from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 57 [Loaded sun.reflect.MethodAccessor from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 58 [Loaded sun.reflect.MethodAccessorImpl from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 59 [Loaded sun.reflect.ConstructorAccessor from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 60 [Loaded sun.reflect.ConstructorAccessorImpl from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 61 [Loaded sun.reflect.DelegatingClassLoader from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 62 [Loaded sun.reflect.ConstantPool from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 63 [Loaded sun.reflect.FieldAccessor from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 64 [Loaded sun.reflect.FieldAccessorImpl from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 65 [Loaded sun.reflect.UnsafeFieldAccessorImpl from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 66 [Loaded sun.reflect.UnsafeStaticFieldAccessorImpl from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 67 [Loaded java.lang.annotation.Annotation from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 68 [Loaded sun.reflect.CallerSensitive from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 69 [Loaded java.lang.invoke.MethodHandle from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 70 [Loaded java.lang.invoke.DirectMethodHandle from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 71 [Loaded java.lang.invoke.MemberName from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 72 [Loaded java.lang.invoke.MethodHandleNatives from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 73 [Loaded java.lang.invoke.LambdaForm from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 74 [Loaded java.lang.invoke.MethodType from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 75 [Loaded java.lang.BootstrapMethodError from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 76 [Loaded java.lang.invoke.CallSite from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 77 [Loaded java.lang.invoke.ConstantCallSite from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 78 [Loaded java.lang.invoke.MutableCallSite from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 79 [Loaded java.lang.invoke.VolatileCallSite from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 80 [Loaded java.lang.Appendable from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 81 [Loaded java.lang.AbstractStringBuilder from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 82 [Loaded java.lang.StringBuffer from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 83 [Loaded java.lang.StringBuilder from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 84 [Loaded sun.misc.Unsafe from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 85 [Loaded java.lang.AutoCloseable from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 86 [Loaded java.io.Closeable from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 87 [Loaded java.io.InputStream from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 88 [Loaded java.io.ByteArrayInputStream from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 89 [Loaded java.io.File from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 90 [Loaded java.net.URLClassLoader from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 91 [Loaded java.net.URL from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 92 [Loaded java.util.jar.Manifest from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 93 [Loaded sun.misc.Launcher from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 94 [Loaded sun.misc.Launcher$AppClassLoader from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 95 [Loaded sun.misc.Launcher$ExtClassLoader from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 96 [Loaded java.security.CodeSource from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 97 [Loaded java.lang.StackTraceElement from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 98 [Loaded java.nio.Buffer from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
 99 [Loaded java.lang.Boolean from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
100 [Loaded java.lang.Character from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
101 [Loaded java.lang.Number from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
102 [Loaded java.lang.Float from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
103 [Loaded java.lang.Double from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
104 [Loaded java.lang.Byte from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
105 [Loaded java.lang.Short from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
106 [Loaded java.lang.Integer from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
107 [Loaded java.lang.Long from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
108 [Loaded java.lang.NullPointerException from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
109 [Loaded java.lang.ArithmeticException from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
110 [Loaded java.io.ObjectStreamField from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
111 [Loaded java.util.Comparator from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
112 [Loaded java.lang.String$CaseInsensitiveComparator from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
113 [Loaded java.security.Guard from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
114 [Loaded java.security.Permission from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
115 [Loaded java.security.BasicPermission from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
116 [Loaded java.lang.RuntimePermission from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
117 [Loaded java.security.AccessController from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
118 [Loaded java.lang.reflect.ReflectPermission from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
119 [Loaded java.security.PrivilegedAction from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
120 [Loaded sun.reflect.ReflectionFactory$GetReflectionFactoryAction from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
121 [Loaded java.security.cert.Certificate from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
122 [Loaded java.lang.Iterable from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
123 [Loaded java.util.Collection from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
124 [Loaded java.util.List from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
125 [Loaded java.util.RandomAccess from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
126 [Loaded java.util.AbstractCollection from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
127 [Loaded java.util.AbstractList from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
128 [Loaded java.util.Vector from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
129 [Loaded java.util.Stack from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
130 [Loaded sun.reflect.ReflectionFactory from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
131 [Loaded java.lang.ref.Reference$Lock from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
132 [Loaded java.lang.ref.Reference$ReferenceHandler from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
133 [Loaded java.lang.InterruptedException from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
134 [Loaded java.util.ArrayList from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
135 [Loaded java.util.Collections from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
136 [Loaded java.util.Set from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
137 [Loaded java.util.AbstractSet from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
138 [Loaded java.util.Collections$EmptySet from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
139 [Loaded java.util.Collections$EmptyList from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
140 [Loaded java.util.AbstractMap from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
141 [Loaded java.util.Collections$EmptyMap from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
142 [Loaded java.util.Collections$UnmodifiableCollection from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
143 [Loaded java.util.Collections$UnmodifiableList from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
144 [Loaded java.util.Collections$UnmodifiableRandomAccessList from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
145 [Loaded java.lang.ref.ReferenceQueue from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
146 [Loaded java.lang.ref.ReferenceQueue$Null from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
147 [Loaded java.lang.ref.ReferenceQueue$Lock from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
148 [Loaded sun.misc.JavaLangRefAccess from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
149 [Loaded java.lang.ref.Reference$1 from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
150 [Loaded sun.misc.SharedSecrets from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
151 [Loaded java.lang.IncompatibleClassChangeError from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
152 [Loaded java.lang.NoSuchMethodError from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
153 [Loaded sun.reflect.Reflection from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
154 [Loaded java.util.HashMap from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
155 [Loaded java.util.Map$Entry from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
156 [Loaded java.util.HashMap$Node from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
157 [Loaded sun.misc.VM from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
158 [Loaded java.util.Hashtable$Entry from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
159 [Loaded java.lang.Math from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
160 [Loaded java.lang.ref.Finalizer$FinalizerThread from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
161 [Loaded java.nio.charset.Charset from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
162 [Loaded java.nio.charset.spi.CharsetProvider from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
163 [Loaded sun.nio.cs.FastCharsetProvider from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
164 [Loaded sun.nio.cs.StandardCharsets from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
165 [Loaded sun.util.PreHashedMap from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
166 [Loaded sun.nio.cs.StandardCharsets$Aliases from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
167 [Loaded sun.nio.cs.StandardCharsets$Classes from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
168 [Loaded sun.nio.cs.StandardCharsets$Cache from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
169 [Loaded java.lang.ThreadLocal from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
170 [Loaded java.util.concurrent.atomic.AtomicInteger from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
171 [Loaded java.lang.Class$3 from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
172 [Loaded java.lang.Class$ReflectionData from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
173 [Loaded java.lang.Class$Atomic from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
174 [Loaded sun.reflect.generics.repository.AbstractRepository from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
175 [Loaded sun.reflect.generics.repository.GenericDeclRepository from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
176 [Loaded sun.reflect.generics.repository.ClassRepository from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
177 [Loaded java.lang.Class$AnnotationData from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
178 [Loaded sun.reflect.annotation.AnnotationType from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
179 [Loaded java.util.WeakHashMap from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
180 [Loaded java.lang.ClassValue$ClassValueMap from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
181 [Loaded java.lang.reflect.Modifier from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
182 [Loaded sun.reflect.LangReflectAccess from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
183 [Loaded java.lang.reflect.ReflectAccess from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
184 [Loaded java.util.Arrays from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
185 [Loaded sun.nio.cs.HistoricallyNamedCharset from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
186 [Loaded sun.nio.cs.Unicode from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
187 [Loaded sun.nio.cs.UTF_8 from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
188 [Loaded java.lang.Class$1 from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
189 [Loaded sun.reflect.ReflectionFactory$1 from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
190 [Loaded sun.reflect.NativeConstructorAccessorImpl from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
191 [Loaded sun.reflect.DelegatingConstructorAccessorImpl from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
192 [Loaded java.lang.StringCoding from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
193 [Loaded java.lang.ThreadLocal$ThreadLocalMap from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
194 [Loaded java.lang.ThreadLocal$ThreadLocalMap$Entry from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
195 [Loaded java.lang.StringCoding$StringDecoder from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
196 [Loaded sun.nio.cs.ArrayDecoder from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
197 [Loaded java.nio.charset.CharsetDecoder from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
198 [Loaded sun.nio.cs.UTF_8$Decoder from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
199 [Loaded java.nio.charset.CodingErrorAction from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
200 [Loaded java.util.Hashtable$EntrySet from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
201 [Loaded java.util.Collections$SynchronizedCollection from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
202 [Loaded java.util.Collections$SynchronizedSet from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
203 [Loaded java.util.Objects from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
204 [Loaded java.util.Enumeration from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
205 [Loaded java.util.Iterator from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
206 [Loaded java.util.Hashtable$Enumerator from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
207 [Loaded java.lang.Runtime from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
208 [Loaded sun.misc.Version from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
209 [Loaded java.io.FileInputStream from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
210 [Loaded java.io.FileDescriptor from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
211 [Loaded sun.misc.JavaIOFileDescriptorAccess from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
212 [Loaded java.io.FileDescriptor$1 from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
213 [Loaded java.io.Flushable from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
214 [Loaded java.io.OutputStream from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
215 [Loaded java.io.FileOutputStream from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
216 [Loaded java.io.FilterInputStream from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
217 [Loaded java.io.BufferedInputStream from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
218 [Loaded java.util.concurrent.atomic.AtomicReferenceFieldUpdater from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
219 [Loaded java.util.concurrent.atomic.AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
220 [Loaded java.security.PrivilegedExceptionAction from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
221 [Loaded java.util.concurrent.atomic.AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl$1 from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
222 [Loaded sun.reflect.misc.ReflectUtil from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
223 [Loaded java.io.FilterOutputStream from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
224 [Loaded java.io.PrintStream from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
225 [Loaded java.io.BufferedOutputStream from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
226 [Loaded java.io.Writer from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
227 [Loaded java.io.OutputStreamWriter from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
228 [Loaded sun.nio.cs.StreamEncoder from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
229 [Loaded sun.security.action.GetPropertyAction from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
230 [Loaded sun.nio.cs.ArrayEncoder from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
231 [Loaded java.nio.charset.CharsetEncoder from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
232 [Loaded sun.nio.cs.UTF_8$Encoder from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
233 [Loaded java.nio.ByteBuffer from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
234 [Loaded java.nio.HeapByteBuffer from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
235 [Loaded java.nio.Bits from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
236 [Loaded java.nio.ByteOrder from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
237 [Loaded java.util.concurrent.atomic.AtomicLong from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
238 [Loaded sun.misc.JavaNioAccess from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
239 [Loaded java.nio.Bits$1 from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
240 [Loaded java.io.BufferedWriter from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
241 [Loaded java.io.DefaultFileSystem from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
242 [Loaded java.io.FileSystem from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
243 [Loaded java.io.UnixFileSystem from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
244 [Loaded java.io.ExpiringCache from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
245 [Loaded java.util.LinkedHashMap from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
246 [Loaded java.io.ExpiringCache$1 from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
247 [Loaded java.lang.Enum from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
248 [Loaded java.io.File$PathStatus from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
249 [Loaded java.nio.file.Watchable from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
250 [Loaded java.nio.file.Path from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
251 [Loaded java.lang.StringCoding$StringEncoder from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
252 [Loaded java.lang.ClassLoader$3 from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
253 [Loaded java.io.ExpiringCache$Entry from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
254 [Loaded java.util.LinkedHashMap$Entry from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
255 [Loaded java.lang.ClassLoader$NativeLibrary from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
256 [Loaded java.lang.Terminator from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
257 [Loaded sun.misc.SignalHandler from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
258 [Loaded java.lang.Terminator$1 from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
259 [Loaded sun.misc.Signal from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
260 [Loaded sun.misc.NativeSignalHandler from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
261 [Loaded java.lang.Integer$IntegerCache from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
262 [Loaded sun.misc.OSEnvironment from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
263 [Loaded sun.misc.JavaLangAccess from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
264 [Loaded java.lang.System$2 from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
265 [Loaded java.lang.IllegalArgumentException from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
266 [Loaded java.lang.Compiler from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
267 [Loaded java.lang.Compiler$1 from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
268 [Loaded java.net.URLStreamHandlerFactory from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
269 [Loaded sun.misc.Launcher$Factory from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
270 [Loaded sun.security.util.Debug from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
271 [Loaded java.lang.ClassLoader$ParallelLoaders from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
272 [Loaded java.util.WeakHashMap$Entry from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
273 [Loaded java.util.Collections$SetFromMap from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
274 [Loaded java.util.WeakHashMap$KeySet from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
275 [Loaded sun.misc.JavaNetAccess from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
276 [Loaded java.net.URLClassLoader$7 from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
277 [Loaded java.util.StringTokenizer from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
278 [Loaded sun.misc.Launcher$ExtClassLoader$1 from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
279 [Loaded sun.misc.MetaIndex from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
280 [Loaded java.lang.Readable from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
281 [Loaded java.io.Reader from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
282 [Loaded java.io.BufferedReader from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
283 [Loaded java.io.InputStreamReader from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
284 [Loaded java.io.FileReader from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
285 [Loaded sun.nio.cs.StreamDecoder from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
286 [Loaded java.nio.CharBuffer from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
287 [Loaded java.nio.HeapCharBuffer from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
288 [Loaded java.nio.charset.CoderResult from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
289 [Loaded java.nio.charset.CoderResult$Cache from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
290 [Loaded java.nio.charset.CoderResult$1 from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
291 [Loaded java.nio.charset.CoderResult$2 from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
292 [Loaded java.lang.reflect.Array from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
293 [Loaded java.util.HashMap$TreeNode from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
294 [Loaded java.io.FileInputStream$1 from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
295 [Loaded sun.net.www.ParseUtil from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
296 [Loaded java.util.BitSet from /usr/local/jdk1.8.0_111/jre/lib/rt.jar]
297 [Loaded java.util

您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 文章轉載自:http://www.pythonheidong.com/blog/article/3329/ 本文為開發者奉獻了70道經典Android面試題加答案--重要知識點幾乎都涉及到了,你還等啥,趕緊收藏吧!! 1. 下列哪些語句關於記憶體回收的說明是正確的? (b) A、 程式員必須創建一個線 ...
  • 文章轉載自:http://www.pythonheidong.com/blog/article/3327/ iOS面試題 1.Difference between shallow copy and deep copy? 淺複製和深複製的區別? 淺層複製:指向對象的指針,而不複製引用對象本身。深層複製 ...
  • Data Structure Notes Chapter 1 Sorting Algorithm Insert Sorting: 對於近乎有序的數組可以降到$ O(n)$的時間複雜度。 Merge Sorting: Tips1 :Merge Sort Optimize in nearly order ...
  • 前言 前面一篇文章寫了 "《SimpleDateFormat 如何安全的使用?》" , 裡面介紹了 SimpleDateFormat 如何處理日期/時間,以及如何保證線程安全,及其介紹了在 Java 8 中的處理時間/日期預設就線程安全的 DateTimeFormatter 類。那麼 Java 8 ...
  • 以 Spring MVC 啟動 Servlet 為例,其應用上下文為 ServletWebServerApplicationContext,繼承了 GenericWebApplicationContext 的大部分方法,主要重寫了 postProcessBeanFactory()、refresh() ...
  • 一個簡單的Restful Crud實驗 預設首頁的訪問設置: 項目結構: Bean: package com.project.javasystem.Bean; public class Department { private Integer id; private String departmen ...
  • 1.日誌文件列表 比如:/data1/logs/2019/08/15/ 10.1.1.1.log.gz 10.1.1.2.log.gz 2.統計日誌中的某關鍵字shell腳本 zcat *.gz|grep 關鍵字 |grep -oP "deviceid=[^=]+"|uniq|sort -u > / ...
  • 本文整理自知乎上的同名討論帖:《為什麼有些大公司技術弱爆了?》,版權歸原作者所有,原文地址: www.zhihu.com/question/32039226 有網友提問: 今年年初,到一家互聯網公司實習,該公司是國內行業龍頭。不過技術和管理方面,卻弱爆了。那裡的程式員,每天都在看郵件,查問題工單。這 ...
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...