Question: class Railway { public static void main(String arg[]) { try { String date = 02/01/2021; BookingTicket T = new BookingTicket(); T.ticket(12725 ,date, 3, 1); System.out.println(Tickets

class Railway { public static void main(String arg[]) { try { String date = "02/01/2021"; BookingTicket T = new BookingTicket(); T.ticket(12725 ,date, 3, 1); System.out.println("Tickets booked successfully."); } catch(RailwayException e) { System.out.println(" Tickets booking failed. Reason : " + e.Errormsg()); } } } class RailwayException extends Exception { int Train; String Error; RailwayException(int Train, String Error) { this.Train = Train; this.Error = Error; } String Errormsg() { return Error; } } class SeatsException extends RailwayException { String Date; SeatsException(int Train, String Date) { super(Train, "There are no seats available for the train " + Train + " on " + Date); this.Date = Date; } } class BookingTicket { public void ticket(int Train, String Date, int Adults, int Children) throws RailwayException { throw new SeatsException(Train, Date); } }

need the flowchart and description of this Java code ASAP

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!