Sobes.tech
Intern — Middle

Defining a universal interface with add and index access operations

livecode

Task condition

It is necessary to create a generalized interface that provides two methods: one for inserting an element, and another for retrieving an element by a given index. The interface should be implementable for any data types using generics.

package com.narozhnyi;

public interface Indexable {
    // method for adding an element
    // method for retrieving an element by index
}