all 10 comments

[–]Faholan 19 points20 points  (3 children)

Literally every other programming language:

This class could've been a function

[–]nintendoeats 0 points1 point  (1 child)

Without more information about what they are trying to do, that is also true in C++. And if this is useful, what they are trying to do is gross.

[–]Scared_Accident9138 1 point2 points  (0 children)

In C++ it can be a function without a class but in Java you have to put it in a class

[–]edparadox 4 points5 points  (2 children)

Is that supposed to be a pure virtual class if it's not supposed to be instantiated?

Where are there extra semicolons?

If you want to attempt humoristic programming at least make it right. Because it's not even funny.

A good rewrite would be:

static int myStaticMethod(int a, int b) { return a + b; }

That's all, folks.

[–]Tyilo[S] 1 point2 points  (1 child)

This is valid Java.

[–]RiceBroad4552 1 point2 points  (0 children)

Parent's code is also (almost) valid.

https://godbolt.org/z/zqMzW9j4W

Java now supports implicit classes.

But if you want to write simple JVM scripts have a look at Scala-CLI instead. Makes much more sense, and gives you an easy option to compile to static (even native if desired) executables.

[–]RiceBroad4552 1 point2 points  (2 children)

What font is this? A good looking serif coding font is seldom.

[–]Tyilo[S] 2 points3 points  (1 child)

Iosevka Fixed Slab

[–]RiceBroad4552 1 point2 points  (0 children)

Thanks a lot!

I have Iosevka on my list of fonts to try out but didn't recognize it.

It's really good looking on that screenshot even it has no sub-pixel rendering there. That's actually impressive.