I'm a beginner in java, and I'm creating a basic CRUD from a library, as I have a lot of operations, I think it's best to do a specialized class for each operation, which will call the methods of the library class. I'm doing the class of the operation register, where it will have to call the methods registerAuthor, registerBook, registerAuthor of the library class.
but I do not know how to call the methods because they are in a different class.
follow the code:
Class Library
public void cadastarAutor(Autor autor) {
this.autores.add(autor);
}
public void cadastrarEditora(Editora editora) {
this.editora.add(editora);
}
public void cadastrarLivro(Livro livro) {
this.livro.add(livro);
}
Class Join
import RepositorioLivros.Biblioteca;
public class Cadastrar {
Biblioteca biblioteca= new Biblioteca();
biblioteca.
}
How do I call the methods of the library class to use in the class Register ?, I instantiated a library in the class register and already tried to do this: library. and call the methods, but when I try Eclipse does not even show the options after . (dot)
The correct would be when I tried to call, the options of the methods that are in the library class appear, but Ñ appears, after I type library. , it gives an error: