0

I'm new to Java world and I'm having problems with ArrayList:

Here is my code:

package ontologia;

import br.ufal.ic.joint.RepositoryFacade;
import br.ufal.ic.joint.module.ontology.operations.OntologyCompiler;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Mauricio
 */
public class NewClass {

    // Caminho do arquivo jar que será gerado
    String ontologyPath = "C:/family.jar";
    // URL da ontologia que deseja ser compilada
    String ontologyURL = "file:///C:/bbcOntology.owl";
    List<String> lista = new ArrayList<String>();

    lista.add(ontologyURL);
    // Chama a fachada do JOINT
    RepositoryFacade fachada = new RepositoryFacade();
    OntologyCompiler compiler = fachada.getOntologyCompiler(ontologyPath, lista); // Gerador do JOINT
    compiler.compile(); // Compila a ontologia em classes Java
}

I'm programming on Netbeans and it is accusing errors on lista.add(ontologyURL);

Am I doing something wrong?

Screenshot

enter image description here

Maurício Giordano
  • 3,116
  • 4
  • 32
  • 60

1 Answers1

1

Code (logical statements) should be inside some method, not directly inside class.

public class NewClass {
  public void someMethod()
   {
    //Here your code goes.
   }

}
kosa
  • 65,990
  • 13
  • 130
  • 167