Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The <code>destination</code> field of <code>FileUploadController</code>, has no access modifier, so it is package private by default. </p> <p>If those two classes are in the same package, you can access it by creating an instance of the class, and using the <code>.</code> operator on the instance to access the property: </p> <pre><code>FileUploadController controller = new FileUploadController(); NewDestination = controller.destination + username + "/"; </code></pre> <p>If they are not, you should implement a <code>public String getDestination()</code> method in <code>FileUploadController</code> that would return <code>destination</code>. You should call this method also by using the <code>.</code> operator: <code>controller.getDestination()</code>.</p> <p>Take into account there are several issues with the code you posted: </p> <ul> <li><p>You're placing code outside a method in the <code>FileDirectoryViewer</code> class. In a class you can only define members (such as fields, or methods). Generally speaking, behavorial code goes inside of method declarations.</p></li> <li><p>Using a hardcoded variable for a path property can be considered bad practice. Look into <code>java.util.Properties</code> for a start. Anyway, by the looks of the code, it doesn't make sense for the <code>destination</code> field to be an instance field, it could be <code>static</code> or defined in an <code>interface</code>.</p></li> <li><p>Naming conventions for java recommend variable names to be camel case, and starting with lower case letters.</p></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload