From 58b78d74ce8d7aa43e22f4f4e409b52a0230b830 Mon Sep 17 00:00:00 2001 From: AlfaizMomin Date: Mon, 7 Oct 2024 18:33:39 +0530 Subject: [PATCH] Create hello.java --- src/hello.java | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/hello.java diff --git a/src/hello.java b/src/hello.java new file mode 100644 index 00000000..107dd421 --- /dev/null +++ b/src/hello.java @@ -0,0 +1,23 @@ +import java.util.logging.Logger; + +public class LoggingExample { + + // Create a logger instance + private static final Logger logger = Logger.getLogger(LoggingExample.class.getName()); + + public static void main(String[] args) { + // Using the logger to log information instead of Sysout + logger.info("Application started."); + + // Application logic + int sum = addNumbers(10, 20); + logger.info("The sum is: " + sum); + + // End of the application + logger.info("Application finished."); + } + + public static int addNumbers(int a, int b) { + return a + b; + } +}