What is the purpose of the final modifier in Java and in what situations is its use justified?
Java
What is the role of the @Primary annotation in the Spring framework and when should it be used?
What is the difference between static and dynamic binding in Java?
Could you explain what the SOLID acronym means in the context of object-oriented programming?
What is a constructor in Java?
How to register a JDBC driver?
Can you highlight your three biggest successes in the past year?
Is it possible to create subclasses of the built-in String type in a programming language?
What is hashCode?
Can you explain what is meant by anti-pattern in programming?
What is the difference between well-formed XML and valid XML?
Which configuration will have priority: XML, Java, or annotations?
What is JavaServer Pages (JSP)?
How did you configure application parameters at your previous job?
@PutMapping("/create") public Book create(Map<String, Object> map) throws Exception { System.out.println("Check if book exists " + map); Book book = new ObjectMapper().convertValue(map, Book.class); Book b = repo.findByTitle(book.getTitle()); if (b != null) { throw new Exception("Book already exists"); } book.setId(UUID.randomUUID().toString()); repo.save(book); log.debug("Book {} by {} is created with id {}", book.getTitle(), book.getAuthor(), book.getId()); return book; } public BookStoreController(BooksRepository repo, Boolean bool, List<String> keys) { this.repo = repo; if (Boolean.TRUE.equals(bool)) { // check first key if(keys != null && !keys.isEmpty()){ String firstKey = keys.get(0); if (firstKey == "public") { for (String key : keys){ // ... some logic log.debug("Using key {}", key); }; } } } }
Is it allowed to have duplicate values within a Set collection?
Design a database schema for a cinema management system, considering information about halls, sessions, and seating.
What are the default equals and hashCode modifiers in Java?
How can a pessimistic locking mechanism be implemented to ensure data integrity in a multithreaded environment?
What is sorting?