Skip to main content
Commonmark migration
Source Link

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

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)

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.

#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.

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.

added 753 characters in body
Source Link
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 hereonline.

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 hereonline.

-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.

#Java 8, 245 243 241 239 238 237 bytes

/**/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 here.

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 here.

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

Explanation:

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

#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.

-1 byte by removing the trailing unnecessary closing-bracket
Source Link
Kevin Cruijssen
  • 131.5k
  • 13
  • 144
  • 384

#Java 8, 245 243 241 239 238238 237 bytes

/**/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 here.Try it here.

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 here.

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

Explanation:

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

#Java 8, 245 243 241 239 238 bytes

/**/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 here.

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 here.

-2 bytes thanks to @OlivierGrégoire.
-2 bytes by creating a port of @SuperStormer's JavaScript answer.

Explanation:

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

#Java 8, 245 243 241 239 238 237 bytes

/**/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 here.

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 here.

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

Explanation:

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

added 107 characters in body
Source Link
Kevin Cruijssen
  • 131.5k
  • 13
  • 144
  • 384
Loading
deleted 5 characters in body
Source Link
Kevin Cruijssen
  • 131.5k
  • 13
  • 144
  • 384
Loading
Was missing an `l` in Hello..
Source Link
Kevin Cruijssen
  • 131.5k
  • 13
  • 144
  • 384
Loading
Source Link
Kevin Cruijssen
  • 131.5k
  • 13
  • 144
  • 384
Loading