/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package jmylistbad; /** * * @author gabriele */ import javax.swing.JOptionPane; public class Main { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here MyListBad l1= new MyListBad(); l1.insert(1);l1.insert(3);l1.insert(5);l1.insert(7);l1.insert(9); MyListBad l2=l1; //l2 e l1 coincidono: nessun errore rispetto al C++ // not so bad!! l2.pop(); JOptionPane.showMessageDialog(null, "Lista l2: "+ l2 +"" ); JOptionPane.showMessageDialog(null, "Lista l1: "+ l1 +"" ); } }