identifier excepted

Joined
Jun 27, 2008
Messages
2
Reaction score
0
Code:
import java.util.ArrayList;
public class Livraria
    {
        
        private ArrayList<Artigo> artigos;
        
        public Livraria()
        {
            artigos = new ArrayList<Artigo>();
        }
        public void juntaArtigo( Artigo a) {
            artigos.add( a);
        }
        public void listarTudo() {
            double valorTotal = 0;
            for (Artigo a : artigos) {
                System.out.println( a);
                valorTotal += a.getValor();
            }
            System.out.println("Valor total dos artigos: "+valorTotal);
        }
        
        public void listarAutor( String aut) {
            for (Artigo a : artigos) {
                if (a instanceof Livro) {
                    Livro l = (Livro)a;
                    if (l.getAutor().equals( aut)) {
                        System.out.println( l);
                    }
                }
            }
        }
        public ArrayList<Artigo> listarTitulo( String tit) {
            ArrayList<Artigo> lista = new ArrayList<Artigo>();
            for (Artigo a : artigos) {
                if (a.getTitulo().equals( tit)) {
                    lista.add( a);
                }
            }
            return lista;
        }
    }

<identifier> expected
@private ArrayList<Artigo> artigos;

also since i havent found anything about it on the inet could u tell me why this happens? wats the meaning of it and when can it happen.

thank you
 
Last edited:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top