hi all,
in my code, only one class object which is c1 displays twice but why not c too?
please help me, i don't understand why is it so.... please anyone
Code:
public static void main(String args[])throws IOException
	{
		Customer c =new Customer();
		Customer c1 =new Customer();
					
		String cname="";
		String uname="";
		int pn=0;
		double bal=0.0;
		int anum=1;
		
		InputStreamReader isr = new InputStreamReader( System.in );
        BufferedReader br = new BufferedReader( isr );
	 ArrayList<Customer> arrayList = new ArrayList<Customer>();
	
	  System.out.println( "Enter your name : " );
      cname = br.readLine( );
	  c.setName(cname);
	  cname=c.getName();
	  System.out.println( "Enter your user name : " );
      uname = br.readLine( );
	  c.setUserName(uname);
	  uname=c.getUserName();
	  System.out.println("Enter your pincode :");
		pn = Integer.parseInt(br.readLine( ));
	  c.setPinCode(pn);
	  pn=c.getPinCode();
	  System.out.println("Enter your balance :");
		bal = Double.parseDouble(br.readLine( ));
	  c.setBalance(bal);
	  bal=c.getBalance();
	  
	  System.out.println( "Enter your name : " );
      cname = br.readLine( );
	  c1.setName(cname);
	  cname=c1.getName();
	  System.out.println( "Enter your user name : " );
      uname = br.readLine( );
	  c1.setUserName(uname);
	  uname=c1.getUserName();
	  System.out.println("Enter your pincode :");
		pn = Integer.parseInt(br.readLine( ));
	  c1.setPinCode(pn);
	  pn=c1.getPinCode();
	  System.out.println("Enter your balance :");
		bal = Double.parseDouble(br.readLine( ));
	  c1.setBalance(bal);
	  bal=c1.getBalance();
	
		c = new Customer(anum , cname , pn , uname , bal);
		c1 = new Customer(anum , cname , pn , uname , bal);		
		arrayList.add(c);
		arrayList.add(c1);
		System.out.println("Account Successfully Created -- The Account Number Assigned Is : " + anum);
				
	System.out.println("size of list"+arrayList.size());	
	
		//*********************display************************
			for(int i=0; i<arrayList.size(); i++)
			{
			System.out.println(arrayList.get(i).toString());
			}
	
		
	}

thanks...