Search:

Type: Posts; User: helloworld922

Search: Search took 0.07 seconds.

  1. Replies
    5
    Views
    2,072

    Re: General question about Interfaces

    Oops, sorry for adding in extra syntax and features.


    ArrayList<Drivable> myVehicles = new ArrayList<Drivable>();

    Drivable is an interface. This declares an ArrayList which can hold anything...
  2. Replies
    5
    Views
    2,072

    Re: General question about Interfaces

    For a single class interfaces aren't terribly useful, and you're right that it looks just like unnecessary overhead/boilerplate code.

    However, consider a few different classes:

    Car, Truck,...
Results 1 to 2 of 2