users@glassfish.java.net

How to initialize a port

From: Kem Elbrader <kem.elbrader_at_gmail.com>
Date: Fri, 10 Aug 2007 11:32:36 -0600

Is there any difference between the following beside the amount of
code? Are there advantages or disadvantages either way?

public someClass {

  @WebServiceRef(value = "WebService")
  WebPort port;
  // ...
}

public someClass {

  WebPort port;

  public someClass() {
    WebService service = new WebService();
    port = service.getPort();
  }
  // ...
}