Can you name the types of documents used for auto-documentation in projects?
Java
What core functionality does the Maven tool provide for managing Java projects?
Where does Spring Boot look for components if there is no @ComponentScan?
What will this code output? public class StreamApi { @Data @AllArgsConstructor public static class Client { private String name; private String city; } public static Map<String, Long> countBy(Stream<Client> clients, Function<Client, String> clientParameterGetter) { return clients.collect(Collectors.groupingBy(clientParameterGetter, TreeMap::new, Collectors.counting())); } public static void main(String[] args) { List<Client> clients = List.of( new Client("Ivanov", "Moscow"), new Client("Mikhailov", "Saint Petersburg"), new Client("Sergeev", "Saint Petersburg"), new Client("Ivanov", null), new Client("Sergeev", null) ); long count = clients.stream() .peek(client -> { if (client.getCity() == null) { client.setCity("Moscow"); } }) .count(); Predicate<Client> clientPredicate = client -> client.getCity() != null; Stream<Client> validClients = clients.stream().filter(clientPredicate); System.out.println(count); System.out.println(countBy(validClients, Client::getName)); System.out.println(countBy(validClients, Client::getCity)); } }
Can you explain how the WeakHashMap class works in Java and how it differs from a regular HashMap?
What data and variables are usually located in the stack during program execution?
What are the advantages and disadvantages of using a linked list to store elements?
What is the difference between using a simple Statement and a prepared PreparedStatement for executing SQL queries in JDBC?
If we use POST, but HTTP (not HTTPS) — what then?
How is the HashMap data structure implemented and how does it ensure quick access to elements?
Why does ArrayList work faster than LinkedList during sequential iteration?
How to determine the first unique element in a sequence of numbers?
Explain the concept of transitive dependency in the context of dependencies in software systems.
Explain the working principle of the pipeline method in Stream and its features.
What is the downside of implementing Singleton through manual code and why is it considered bad practice?
How can you set up actions to be performed when deleting a bean in a container?
Have you used the try-with-resources construct in Java for automatic resource management?
Tell us about the internal memory device in Java and how garbage collectors work.
How to handle exceptions in reactive code?
What is the purpose of using annotations in programming?