Advertisement
alandmx40

Atividade - Classe Principal

Jul 12th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.93 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6.  
  7. /**
  8.  *
  9.  * @author Aluno
  10.  */
  11. public class Principal {
  12.    
  13.     public static void main(String args[]){
  14.        
  15.         Livraria liv= new Livraria(15);
  16.         Livro l = new Livro("Aula","Alan",20);
  17.         liv.adicionarLivro(l);
  18.        
  19.         Livro l2 = new Livro("PROO","Alan",30);
  20.         liv.adicionarLivro(l2);
  21.        
  22.         System.out.println("Numero de livros da livraria: "+liv.obterQtdadedeLivro());
  23.         Livro p = liv.buscarLivro("PROO");
  24.        
  25.         if(p == null){
  26.            
  27.             System.out.println("Livro não encontrado");
  28.            
  29.         }else {
  30.            
  31.             System.out.println("Livro encontrado");
  32.            
  33.         }
  34.        
  35.         liv.exibirLivros();
  36.     }
  37.    
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement