I'm writing a program in which it will asks the user to enter some entries like Name, Surname etc and then store all those entries in one location of an arraylist. In other words variables ( name, surname, telephone ) will be added to location 0 of arraylist.
The difficulty I'm finding is when it comes to get all those variables and store them into the location of the array list. Can someone help me ? Thanks.
public class Loans
{
ArrayList lns = new ArrayList();
void LoansInput ()
{
// Add New Loan Button
// Requesting DVD ID
String dvdid;
dvdid =JOptionPane.showInputDialog("Enter DVD ID Number");
// Requesting Member Name & Surname
String namesurname;
namesurname = JOptionPane.showInputDialog("Client Name & Surname");
// Requesting Member ID Number
String mid;
mid =JOptionPane.showInputDialog("Client ID Number");
// Requesting Member ID Number
String telephone;
telephone =JOptionPane.showInputDialog("Client Telephone Number");
// Requesting Rental Date
String rentaldate;
rentaldate =JOptionPane.showInputDialog("Rental Date (DD-MM-YY)");
// Requesting Return Date
String returndate;
returndate =JOptionPane.showInputDialog("Return Date (DD-MM-YY)");
What should I add here in order to get all this variables and put them in the Arraylist lns in one location? (Not every entry in different locations)