8 questions for “Logging in Java (java.util.logging”

Found in 1 field. Select a question to see its full answer.

Information Technology

8 questions in 1 technology

#QuestionTechnologyTopicLevel
1What is the purpose of overriding toString(), and what's the difference between Object's default implementation and a well-designed custom one? Java › equals(), hashCode() & toString() ContractsJavaequals(), hashCode() & toString() ContractsIntermediate
2How does the Instant class represent a point in time, and how does it differ fundamentally from ZonedDateTime in terms of what it actually represents and how it should be used? Java › Java Date & Time API (java.time)JavaJava Date & Time API (java.time)Advanced
3How would you design and implement a global, centralized exception-handling strategy for a Java application (such as a top-level handler in main(), or an uncaught exception handler for background threads), ensuring no exception silently crashes the application without being logged? Java › ExceptionsJavaExceptionsAdvanced
4What is a common anti-pattern with catching exceptions too broadly (catch (Exception e) or worse, catch (Throwable t)), and why is it generally discouraged? Java › ExceptionsJavaExceptionsIntermediate
5What is the purpose of the addSuppressed() mechanism and getSuppressed() method on Throwable, and in what specific scenario does the JVM automatically populate suppressed exceptions? Java › ExceptionsJavaExceptionsIntermediate
6What is the purpose of the PrintStream and PrintWriter classes (like System.out), and how do they differ from lower-level OutputStream/Writer in their exception-handling behavior? Java › I/O & NIOJavaI/O & NIOIntermediate
7How does exception chaining (via the cause mechanism, initCause() or a constructor accepting a Throwable) preserve the original root-cause exception when wrapping and rethrowing a different exception type, and why does this matter for debugging? Java › ExceptionsJavaExceptionsAdvanced
8How would you implement a custom checked exception that requires additional context to be attached as the exception propagates up multiple layers of a call stack, without losing information at each layer? Java › ExceptionsJavaExceptionsAdvanced