-1
I started learning Java with the Ellipse and I’m learning more and more every day. But I came across a situation: when I use the system.out.println("");
, Eclipse "says" there is a syntax error and I have no idea what that might be. I have tried using shortcut "syso" + Ctrl+ Space but the option doesn’t even appear. I searched for answers on this and other sites but I didn’t find my problem.
The version of Eclipse I use is Eclipse IDE for Java EE Developers (Mars).
I will post an image showing the syntax error which appears together with the code.
Thanks in advance! Thank you for your attention.
Code below:
package cadastro;
// 08
import java.util.ArrayList;
import java.util.HashMap;
import dados.Cliente;
import dados.Produto;
import dados.Venda;
import utilitarios.Console;
public class Cadastro {
public static HashMap<String, Cliente> listaCliente = new HashMap<>();
public static HashMap<Integer, Produto> listaProduto = new HashMap<>();
public static HashMap<Integer, Venda> listaVenda = new HashMap<>();
public static void incluirCliente (Cliente obj ) {
listaCliente.put(obj.getCpf(), obj);
}
public static void excluirCliente (Cliente obj) {
listaCliente.remove(obj);
}
public static ArrayList<Cliente> pesqClienteCpf (String cpf) {
ArrayList<Cliente> resposta = new ArrayList<>();
for (Cliente obj : listaCliente.values()) {
if (obj.getCpf().contains(cpf)){
resposta.add(obj);
}
}
return resposta;
}
// 11
public static ArrayList<Cliente> pesqClienteNome(String nome) {
ArrayList<Cliente> resposta = new ArrayList<>();
for (Cliente obj : listaCliente.values()) {
if (obj.getNome().contains(nome)) {
resposta.add(obj);
}
}
return resposta;
}
public static void incluirProduto (Produto obj) {
listaProduto.put(obj.getCodigo(), obj);
}
public static void excluirProduto (Produto obj) {
listaProduto.remove(obj.getCodigo());
}
public static ArrayList<Produto> pesqProdutoCodigo (int produto) {
ArrayList<Produto> resposta = new ArrayList<>();
for (Produto obj : listaProduto.values()) {
if (obj.getCodigo() == produto) {
resposta.add(obj);
}
}
return resposta;
}
public static void incluirVenda (Venda obj) {
listaVenda.put(obj.getNumVenda(), obj);
}
public static void excluirVenda (Venda obj) {
listaVenda.remove(obj.getNumVenda());
}
system.out.println("asdasd");
}
The correct is
System.out.println
. The classSystem
is with the largest S.– user28595
Still the same mistake. :/
– Brenner Passos
What do you want with this command? It is useless in your code, simply remove it.
– user28595
I know it was useless, I just didn’t understand why it was wrong. But now I understand, sorry for the question.
– Brenner Passos