Skip to main content

Posts

Showing posts from 2020

OLA-UBER Problem

Create two interfaces OLA and UBER both having a method public static Cab getCab() which returns the Cab object where Cab is a nested class inside OLA and UBER. Cab must have attributes cab_number and driver_name. A user rides 5 times using cabs of OLA and UBER randomly which are stored in an array. Now implement a method which should display the name of the driver and the company name i.e. OLA/UBER when the valid cab_number is entered by the user. Display "Invalid CAB details" when the cab_number entered by the user is incorrect.