Skip to content

方法比较 #5

@zjqwll

Description

@zjqwll

@component
public class ImProperties {

public static String WEBSOCKET_SERVER_URL;

@PostConstruct
private void init() {
    WEBSOCKET_SERVER_URL = websocketServerUrl;
}

@Value(value = "${netty.socketio.server.host}")
private String websocketServerUrl;

}

我想问下用静态方法这样写和直接用get,set这么写有什么好处?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions