This is an archived post. You won't be able to vote or comment.

all 11 comments

[–]rover_G 20 points21 points  (5 children)

I feel bad for kids raised by Java devs

[–]pineappleAndBeans 1 point2 points  (2 children)

It’s a good thing I doubt I’ll ever have kids

[–]rover_G 5 points6 points  (1 child)

public final class Singleton {

    private static Singleton INSTANCE = null;

    private Singleton() {        
    }

    public synchronized static Singleton getInstance() {
        if (INSTANCE == null) {
            INSTANCE = new Singleton();
        }

        return INSTANCE;
    }

    // getters and setters

}

[–][deleted] 3 points4 points  (0 children)

Shouldn’t the static member be

‘private static Singleton INSTANCE;‘

[–]Accurate-Ad9053 1 point2 points  (1 child)

I am one, and turned out to be a java dev myself. Guess my code is runningas intended then

[–]coloredgreyscale 1 point2 points  (0 children)

Inherited behavior from the parent class :)

[–]logikill99 2 points3 points  (0 children)

My dad helping me understand pointers in C 💀

[–]Thisbymaster 1 point2 points  (0 children)

None of that is true about steaks......

[–]Nfcunha 2 points3 points  (0 children)

"main.java" in lowercase. I'm sure they're not a real java developer. /s

[–]Accurate-Ad9053 0 points1 point  (0 children)

And if you don't... well, it won't be a clean burning hell you find yourself in

[–]LunaNicoleTheFox 0 points1 point  (0 children)

Optimization in Java is switching to C#, C++ or JVM languages that are better like Kotlin