How to overwrite classes from jdk?

后端 未结 4 1477
感情败类
感情败类 2021-01-21 00:10

I\'m trying to change some classes from open jdk, so I\'m creating the same package structure as the open jdk classes have and I\'m changing the classes using netbeans. When i\'

4条回答
  •  青春惊慌失措
    2021-01-21 00:59

    You should create your class in your own package and have the application that uses this class import your class instead. So you can create a class called HttpsURLConnectionImpl in package com.yourdomain.

    Then in the application code make sure that you import:

      import com.yourdomain.HttpsURLConnectionImpl;
    

    Then in your code your own class will be used.

提交回复
热议问题