How to get getclass().getResource() from a static context?

前端 未结 5 2052
名媛妹妹
名媛妹妹 2020-12-30 19:14

I have a function where I am trying to load a file to a URL object, because the example project said so.

public class SecureFTP {

    public s         


        
5条回答
  •  不知归路
    2020-12-30 19:48

    From: How to call getClass() from a static method in Java?

    Just use TheClassName.class instead of getClass().

提交回复
热议问题