Hi new to the forums so Hi to everyone, I hope someone out there can point me in right direction.
I have a programme creating object orienated items in an array all the questions are asked and then sent to a seperate class but how do i edit it as a whole entry code is below what i want to be able to do for instance is changed all the details but for a user to select the array to change. i have attached part of main program code for normal adding this is when the arrays are empty and also code for the class that bject is sent to,
if(choice.equals("1")) { //get book details System.out.print("Enter the Taxi Number. "); TaxiNo = input.next(); System.out.print("Enter the Taxi Registration(without spaces) "); TaxiReg = input.next(); System.out.print("Enter the amount of seats available. "); TaxiSeats = input.next(); System.out.print("Is this taxi in service(Y/N) "); TaxiServ = input.next(); System.out.print("Enter the Taxi Location. "); TaxiLoco = input.next(); //creat a new object called taxi 1 based on the taxi class taxis[taxisInRank] = new Taxi(TaxiNo, TaxiReg, TaxiSeats, TaxiServ, TaxiLoco); taxisInRank++; System.out.println("Taxi object created"); System.out.println(); }
and the taxi class code
//Taxi class class Taxi { private String No; private String Reg; private String Seats; private String Serv; private String Loco; //constructor Taxi (String n, String r, String s, String ser, String l) { No = n; Reg = r; Seats = s; Serv = ser; Loco = l; } //method to get title and date String getNo() { return No; } String getReg() { return Reg; } String getSeats() { return Seats; } String getServ() { return Serv; } String getLoco() { return Loco; } }
Many thanks in advance