Skip to main content

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.

Comments

  1. This article is a great article that I have seen in my java programming career so far.

    website development company in Surat Gujarat

    ReplyDelete
  2. Hello! I want to say that this article is amazing, nice written and come with almost all vital Information. I would like to see more posts like this. Some Questions to Check How Serious Your Prospect is for Buying

    ReplyDelete

  3. I am is grateful for the article. I am really looking forward to reading more. Also read this..
    5 Mistakes Beginner Web Developers Commit and How to Fix Them

    ReplyDelete

Post a Comment

Popular posts from this blog

ETE Practice Set-1

                                                                 Mock Test-1 -----------------------------------------------------------------------------------------------------------------------------   1 (a) Write a program that reads 10 integers between 1 and 100 and counts the occurrences of each. Assume the input ends with 0.                                                         ...

Practice Set: Unit-4

                                                                                                                Practice Set: Unit 4 1. What are the uses of super keyword in Java? Explain with a suitable example. 2. What are the various uses of final keyword in java? An abstract method can not be declared final. Why? 3. Differentiate between Abstract class and Interface. What do you mean by Functional interface and Lambda Expression?  ...