List-based implementation

Report a typo

Write an implementation of the UserDao interface using the List data structure. Do not print any messages inside your implementation code and do not change the provided code of the classes.

Sample Input 1:

0
John
1
Jack
10

Sample Output 1:

Found User [id 0, name : John]
Not found id 10
Found User [id 1, name : Jack]
Updated User [id 1, name : UPDATED]
Deleted id: 1
Write a program in Java 17
import java.util.*;

class User {
private int id;
private String name;

public User(int id, String name) {
this.id = id;
this.name = name;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public int getId() {
return id;
}

public void setId(int id) {
this.id = id;
}

@Override
public String toString() {
return "User [id " + id + ", name : " + name + "]";
}
}

interface UserDao {

void add(User user);
___

Create a free account to access the full topic