Issue
- I checked all imports they are correct the only error I am getting is while calling the
List.of()
method.
UserDao user1 = new UserDao();
user1.setName("j");
user1.setUser_name("k");
user1.setPassword("l");
user1.setPhone("86632");
UserDao user2 = new UserDao();
user1.setName("j");
user1.setUser_name("k");
user1.setPassword("l");
user1.setPhone("86632");
- Here the
of
method is not found in spring tool suite I am onjre1.8
List<UserDao> users = List.of(user1, user2);
Iterable<UserDao> itrb = userRepo.saveAll(users);
Solution
You should upgrade to Java9 to use List.of
function, or use Arrays.asList
instead.
Answered By - Tracholar Zuo
Answer Checked By - Marie Seifert (JavaFixing Admin)