Skip to main content
6 of 7
added 753 characters in body
Kevin Cruijssen
  • 131.5k
  • 13
  • 144
  • 384

#Java 8, 245 243 241 239 238 237 bytes (full program)

/**/interface M{static void main(String[]a){System.out.print("Hello, World!");}}//**/ iinntteerrffaaccee  MM{{ssttaattiicc  vvooiidd  mmaaiinn((SSttrriinngg[[]]aa)){{SSyysstteemm..oouutt..pprriinntt((""HHeelllloo,,  WWoorrlldd!!""));;}}}

Try it online.

After removing every other character:

/*itraeMsai odmi(tig])Sse.u.rn(Hlo ol!)}/*/interface M{static void main(String[]a){System.out.print("Hello, World!");}}

Try it online.

-2 bytes (243 → 241) thanks to @OlivierGrégoire.
-2 bytes (241 → 239) by creating a port of @SuperStormer's JavaScript answer.


#Java 8, 63 bytes (lambda function)

/**/v->"Hello, World!"//**/vv-->>""HHeelllloo,,  WWoorrlldd!!""

Try it online.

After removing every other character:

/*v>Hlo ol!/*/v->"Hello, World!"

Try it online.

Explanation:

Utilizes //abc single-line comments and /*abc*/ multi-line comments.
See the Java-highlighting of the two programs/functions to see how these type of comments are used.

Kevin Cruijssen
  • 131.5k
  • 13
  • 144
  • 384