Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. case 4:{
  2. if(cont>0){
  3. int c = cont-1;
  4. System.out.println("Posizione della lampada da eliminare(Da 0 a " + c + "): " );
  5. int del = tastiera.nextInt();
  6. if(del>=0 && del<dim){
  7. if(cont==1){
  8. array[del] = new lampa();
  9. }
  10. else{
  11. array[del] = new lampa(array[c]);
  12. array[c] = new lampa();
  13. }
  14. System.out.println("Eliminata!");
  15. cont--;
  16. }
  17. else
  18. System.out.println("Numero non valido!");
  19. }
  20. else
  21. System.out.println("Magazzino Vuoto!");
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement