Skip to content

Add Java Hello World demo project#4

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/add-hello-world-demo
Draft

Add Java Hello World demo project#4
Copilot wants to merge 2 commits intomainfrom
copilot/add-hello-world-demo

Conversation

Copy link

Copilot AI commented Mar 3, 2026

Adds a minimal Maven-based Java project demonstrating a Hello World program, suitable for workshop demos.

Structure

  • java-hello-world/pom.xml — Maven build, Java 17, JUnit Jupiter 5.10.2
  • src/main/java/com/example/HelloWorld.javagreet(String name) with null/blank fallback + main entry point
  • src/test/java/com/example/HelloWorldTest.java — 4 unit tests covering standard, custom name, null, and blank inputs

Usage

cd java-hello-world
mvn clean package
java -jar target/java-hello-world-1.0.0.jar  # → Hello, World!

Notes

  • .gitignore updated to exclude Java build artifacts (*.class, *.jar, *.war, *.ear, target/)
  • greet() defaults to "World" on null or blank input rather than throwing NullPointerException
Original prompt

help me create a new java project that is basically used to demo hello world

Created from VS Code.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: huangyingting <24954047+huangyingting@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Hello World demo for Java project Add Java Hello World demo project Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants