232k views
2 votes
Consider a class ClassName whose methods are listed below. What class is it?

ClassName(){...}
boolean isEmpty(){...}
void display(){...}
boolean search(int x){...}
void insert(int i){...}
void remove(int x){...}

1 Answer

3 votes

Answer:

An implementation of java.util.List interface

Step-by-step explanation:

Given class consists of the following constructs:

  • Constructor
  • isEmpty,search, display
  • insert,remove

It supports inserting and removing an element at a specified index. It also supports search and display operations.

These are characteristics of an object which implements the java.util.List interface ( For example: ArrayList or user-defined customList ).

User Bagira
by
8.4k points