Skip to content

Latest commit

 

History

History
11 lines (5 loc) · 1.51 KB

task_select_example.md

File metadata and controls

11 lines (5 loc) · 1.51 KB

examples of API selection task

  1. From the Stack Overflow question Instant vs LocalDateTime - When to prefer one over the other, the scenario description "I need to save and present datetime of events that happened in my server in UTC. I have the option of using Instant.now() or LocalDateTime.now()" is proposed by the questioner of the post. The comparison APIs are java.time.Instant.now() and java.time.LocalDateTime.now(java.time.ZoneId).

  2. From the Stack Overflow question What is the difference between getDeclaredConstructors and getConstructors in the Class API?, based on the problem description, we define the scenario description "what is the purpose of accessing a private constructor?". The comparison APIs are java.lang.Class.getConstructors() and java.lang.Class.getDeclaredConstructors().

  3. From the Stack Overflow question Differences between HashMap and Hashtable?, the scenario description "Which is more efficient for non-threaded applications?" is proposed by the questioner of the post. The comparison APIs are java.util.HashMap and java.util.Hashtable.

For all API selection task results, you can view the file