April 2018
Intermediate to advanced
382 pages
10h 11m
English
public class User implements Serializable{ private Long id; private String name; public User(long id, String name){ this.id = id; this.name = name; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } }
@Statelesspublic class UserBean { public User getUser(){ long id = new Date().getTime(); try { TimeUnit.SECONDS.sleep(5); return new User(id, "User " + id); } catch (InterruptedException ex) { System.err.println(ex.getMessage()); return new User(id, "Error " + id); } }}
Read now
Unlock full access